<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>module ActionView::Helpers::FormHelper - Rails Framework Documentation</title>

<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
</script>

<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>


<body id="top" class="module">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="../../index.html">Home</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    
    <!-- Included Modules -->
<nav id="includes-section" class="section">
  <h3 class="section-header">Included Modules</h3>

  <ul class="link-list">
  
  
    <li><a class="include" href="FormTagHelper.html">ActionView::Helpers::FormTagHelper</a>
  
  
  
    <li><a class="include" href="UrlHelper.html">ActionView::Helpers::UrlHelper</a>
  
  
  </ul>
</nav>

    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-i-check_box">#check_box</a>
    
    <li><a href="#method-i-convert_to_model">#convert_to_model</a>
    
    <li><a href="#method-i-email_field">#email_field</a>
    
    <li><a href="#method-i-fields_for">#fields_for</a>
    
    <li><a href="#method-i-file_field">#file_field</a>
    
    <li><a href="#method-i-form_for">#form_for</a>
    
    <li><a href="#method-i-hidden_field">#hidden_field</a>
    
    <li><a href="#method-i-label">#label</a>
    
    <li><a href="#method-i-number_field">#number_field</a>
    
    <li><a href="#method-i-password_field">#password_field</a>
    
    <li><a href="#method-i-phone_field">#phone_field</a>
    
    <li><a href="#method-i-radio_button">#radio_button</a>
    
    <li><a href="#method-i-range_field">#range_field</a>
    
    <li><a href="#method-i-search_field">#search_field</a>
    
    <li><a href="#method-i-telephone_field">#telephone_field</a>
    
    <li><a href="#method-i-text_area">#text_area</a>
    
    <li><a href="#method-i-text_field">#text_field</a>
    
    <li><a href="#method-i-url_field">#url_field</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionmailer-3_2_7/MIT-LICENSE.html">MIT-LICENSE</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionmailer-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionpack-3_2_7/MIT-LICENSE.html">MIT-LICENSE</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionpack-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activemodel-3_2_7/MIT-LICENSE.html">MIT-LICENSE</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activemodel-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activerecord-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activeresource-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activesupport-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/railties-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../../README_rdoc.html">README</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="../../ActiveRecord.html">ActiveRecord</a>
  
    <li><a href="../../ActiveRecord/ActiveRecordError.html">ActiveRecord::ActiveRecordError</a>
  
    <li><a href="../../ActiveRecord/AdapterNotFound.html">ActiveRecord::AdapterNotFound</a>
  
    <li><a href="../../ActiveRecord/AdapterNotSpecified.html">ActiveRecord::AdapterNotSpecified</a>
  
    <li><a href="../../ActiveRecord/Aggregations.html">ActiveRecord::Aggregations</a>
  
    <li><a href="../../ActiveRecord/Aggregations/ClassMethods.html">ActiveRecord::Aggregations::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AssociationTypeMismatch.html">ActiveRecord::AssociationTypeMismatch</a>
  
    <li><a href="../../ActiveRecord/Associations.html">ActiveRecord::Associations</a>
  
    <li><a href="../../ActiveRecord/Associations/ClassMethods.html">ActiveRecord::Associations::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeAssignment.html">ActiveRecord::AttributeAssignment</a>
  
    <li><a href="../../ActiveRecord/AttributeAssignment/ClassMethods.html">ActiveRecord::AttributeAssignment::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeAssignmentError.html">ActiveRecord::AttributeAssignmentError</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods.html">ActiveRecord::AttributeMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/BeforeTypeCast.html">ActiveRecord::AttributeMethods::BeforeTypeCast</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/ClassMethods.html">ActiveRecord::AttributeMethods::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/DeprecatedUnderscoreRead.html">ActiveRecord::AttributeMethods::DeprecatedUnderscoreRead</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/DeprecatedUnderscoreRead/ClassMethods.html">ActiveRecord::AttributeMethods::DeprecatedUnderscoreRead::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Dirty.html">ActiveRecord::AttributeMethods::Dirty</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/PrimaryKey.html">ActiveRecord::AttributeMethods::PrimaryKey</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/PrimaryKey/ClassMethods.html">ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Query.html">ActiveRecord::AttributeMethods::Query</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Read.html">ActiveRecord::AttributeMethods::Read</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Read/ClassMethods.html">ActiveRecord::AttributeMethods::Read::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Serialization.html">ActiveRecord::AttributeMethods::Serialization</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Serialization/Attribute.html">ActiveRecord::AttributeMethods::Serialization::Attribute</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Serialization/ClassMethods.html">ActiveRecord::AttributeMethods::Serialization::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/TimeZoneConversion.html">ActiveRecord::AttributeMethods::TimeZoneConversion</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/TimeZoneConversion/ClassMethods.html">ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Write.html">ActiveRecord::AttributeMethods::Write</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Write/ClassMethods.html">ActiveRecord::AttributeMethods::Write::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AutosaveAssociation.html">ActiveRecord::AutosaveAssociation</a>
  
    <li><a href="../../ActiveRecord/AutosaveAssociation/ClassMethods.html">ActiveRecord::AutosaveAssociation::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Base.html">ActiveRecord::Base</a>
  
    <li><a href="../../ActiveRecord/Batches.html">ActiveRecord::Batches</a>
  
    <li><a href="../../ActiveRecord/Calculations.html">ActiveRecord::Calculations</a>
  
    <li><a href="../../ActiveRecord/Callbacks.html">ActiveRecord::Callbacks</a>
  
    <li><a href="../../ActiveRecord/ConfigurationError.html">ActiveRecord::ConfigurationError</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/AbstractAdapter.html">ActiveRecord::ConnectionAdapters::AbstractAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html">ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/ConnectionHandler.html">ActiveRecord::ConnectionAdapters::ConnectionHandler</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/ConnectionManagement.html">ActiveRecord::ConnectionAdapters::ConnectionManagement</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/ConnectionPool.html">ActiveRecord::ConnectionAdapters::ConnectionPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/DatabaseLimits.html">ActiveRecord::ConnectionAdapters::DatabaseLimits</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/DatabaseStatements.html">ActiveRecord::ConnectionAdapters::DatabaseStatements</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/Mysql2Adapter.html">ActiveRecord::ConnectionAdapters::Mysql2Adapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/MysqlAdapter.html">ActiveRecord::ConnectionAdapters::MysqlAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/MysqlAdapter/StatementPool.html">ActiveRecord::ConnectionAdapters::MysqlAdapter::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/StatementPool.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/TableDefinition.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/Utils.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Utils</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLColumn.html">ActiveRecord::ConnectionAdapters::PostgreSQLColumn</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/QueryCache.html">ActiveRecord::ConnectionAdapters::QueryCache</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/Quoting.html">ActiveRecord::ConnectionAdapters::Quoting</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter/ExplainPrettyPrinter.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter::ExplainPrettyPrinter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter/StatementPool.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter/Version.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter::Version</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SchemaCache.html">ActiveRecord::ConnectionAdapters::SchemaCache</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SchemaStatements.html">ActiveRecord::ConnectionAdapters::SchemaStatements</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/StatementPool.html">ActiveRecord::ConnectionAdapters::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/Table.html">ActiveRecord::ConnectionAdapters::Table</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/TableDefinition.html">ActiveRecord::ConnectionAdapters::TableDefinition</a>
  
    <li><a href="../../ActiveRecord/ConnectionNotEstablished.html">ActiveRecord::ConnectionNotEstablished</a>
  
    <li><a href="../../ActiveRecord/ConnectionTimeoutError.html">ActiveRecord::ConnectionTimeoutError</a>
  
    <li><a href="../../ActiveRecord/CounterCache.html">ActiveRecord::CounterCache</a>
  
    <li><a href="../../ActiveRecord/DangerousAttributeError.html">ActiveRecord::DangerousAttributeError</a>
  
    <li><a href="../../ActiveRecord/Delegation.html">ActiveRecord::Delegation</a>
  
    <li><a href="../../ActiveRecord/DynamicFinderMatch.html">ActiveRecord::DynamicFinderMatch</a>
  
    <li><a href="../../ActiveRecord/DynamicMatchers.html">ActiveRecord::DynamicMatchers</a>
  
    <li><a href="../../ActiveRecord/DynamicScopeMatch.html">ActiveRecord::DynamicScopeMatch</a>
  
    <li><a href="../../ActiveRecord/Explain.html">ActiveRecord::Explain</a>
  
    <li><a href="../../ActiveRecord/FinderMethods.html">ActiveRecord::FinderMethods</a>
  
    <li><a href="../../ActiveRecord/Fixtures.html">ActiveRecord::Fixtures</a>
  
    <li><a href="../../ActiveRecord/Fixtures/File.html">ActiveRecord::Fixtures::File</a>
  
    <li><a href="../../ActiveRecord/IdentityMap.html">ActiveRecord::IdentityMap</a>
  
    <li><a href="../../ActiveRecord/IdentityMap/Middleware.html">ActiveRecord::IdentityMap::Middleware</a>
  
    <li><a href="../../ActiveRecord/Inheritance.html">ActiveRecord::Inheritance</a>
  
    <li><a href="../../ActiveRecord/Inheritance/ClassMethods.html">ActiveRecord::Inheritance::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Integration.html">ActiveRecord::Integration</a>
  
    <li><a href="../../ActiveRecord/InvalidForeignKey.html">ActiveRecord::InvalidForeignKey</a>
  
    <li><a href="../../ActiveRecord/IrreversibleMigration.html">ActiveRecord::IrreversibleMigration</a>
  
    <li><a href="../../ActiveRecord/Locking.html">ActiveRecord::Locking</a>
  
    <li><a href="../../ActiveRecord/Locking/Optimistic.html">ActiveRecord::Locking::Optimistic</a>
  
    <li><a href="../../ActiveRecord/Locking/Optimistic/ClassMethods.html">ActiveRecord::Locking::Optimistic::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Locking/Pessimistic.html">ActiveRecord::Locking::Pessimistic</a>
  
    <li><a href="../../ActiveRecord/LogSubscriber.html">ActiveRecord::LogSubscriber</a>
  
    <li><a href="../../ActiveRecord/Migration.html">ActiveRecord::Migration</a>
  
    <li><a href="../../ActiveRecord/Migration/CommandRecorder.html">ActiveRecord::Migration::CommandRecorder</a>
  
    <li><a href="../../ActiveRecord/MigrationProxy.html">ActiveRecord::MigrationProxy</a>
  
    <li><a href="../../ActiveRecord/ModelSchema.html">ActiveRecord::ModelSchema</a>
  
    <li><a href="../../ActiveRecord/ModelSchema/ClassMethods.html">ActiveRecord::ModelSchema::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/MultiparameterAssignmentErrors.html">ActiveRecord::MultiparameterAssignmentErrors</a>
  
    <li><a href="../../ActiveRecord/NestedAttributes.html">ActiveRecord::NestedAttributes</a>
  
    <li><a href="../../ActiveRecord/NestedAttributes/ClassMethods.html">ActiveRecord::NestedAttributes::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/NestedAttributes/TooManyRecords.html">ActiveRecord::NestedAttributes::TooManyRecords</a>
  
    <li><a href="../../ActiveRecord/Observer.html">ActiveRecord::Observer</a>
  
    <li><a href="../../ActiveRecord/Persistence.html">ActiveRecord::Persistence</a>
  
    <li><a href="../../ActiveRecord/Persistence/ClassMethods.html">ActiveRecord::Persistence::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/PreparedStatementInvalid.html">ActiveRecord::PreparedStatementInvalid</a>
  
    <li><a href="../../ActiveRecord/QueryCache.html">ActiveRecord::QueryCache</a>
  
    <li><a href="../../ActiveRecord/QueryCache/ClassMethods.html">ActiveRecord::QueryCache::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/QueryMethods.html">ActiveRecord::QueryMethods</a>
  
    <li><a href="../../ActiveRecord/Querying.html">ActiveRecord::Querying</a>
  
    <li><a href="../../ActiveRecord/Railtie.html">ActiveRecord::Railtie</a>
  
    <li><a href="../../ActiveRecord/Railties.html">ActiveRecord::Railties</a>
  
    <li><a href="../../ActiveRecord/Railties/ControllerRuntime.html">ActiveRecord::Railties::ControllerRuntime</a>
  
    <li><a href="../../ActiveRecord/Railties/ControllerRuntime/ClassMethods.html">ActiveRecord::Railties::ControllerRuntime::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/ReadOnlyRecord.html">ActiveRecord::ReadOnlyRecord</a>
  
    <li><a href="../../ActiveRecord/ReadonlyAttributes.html">ActiveRecord::ReadonlyAttributes</a>
  
    <li><a href="../../ActiveRecord/ReadonlyAttributes/ClassMethods.html">ActiveRecord::ReadonlyAttributes::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/RecordInvalid.html">ActiveRecord::RecordInvalid</a>
  
    <li><a href="../../ActiveRecord/RecordNotFound.html">ActiveRecord::RecordNotFound</a>
  
    <li><a href="../../ActiveRecord/RecordNotSaved.html">ActiveRecord::RecordNotSaved</a>
  
    <li><a href="../../ActiveRecord/RecordNotUnique.html">ActiveRecord::RecordNotUnique</a>
  
    <li><a href="../../ActiveRecord/Reflection.html">ActiveRecord::Reflection</a>
  
    <li><a href="../../ActiveRecord/Reflection/ClassMethods.html">ActiveRecord::Reflection::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Reflection/MacroReflection.html">ActiveRecord::Reflection::MacroReflection</a>
  
    <li><a href="../../ActiveRecord/Relation.html">ActiveRecord::Relation</a>
  
    <li><a href="../../ActiveRecord/Result.html">ActiveRecord::Result</a>
  
    <li><a href="../../ActiveRecord/Rollback.html">ActiveRecord::Rollback</a>
  
    <li><a href="../../ActiveRecord/Sanitization.html">ActiveRecord::Sanitization</a>
  
    <li><a href="../../ActiveRecord/Sanitization/ClassMethods.html">ActiveRecord::Sanitization::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Schema.html">ActiveRecord::Schema</a>
  
    <li><a href="../../ActiveRecord/Scoping.html">ActiveRecord::Scoping</a>
  
    <li><a href="../../ActiveRecord/Scoping/ClassMethods.html">ActiveRecord::Scoping::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Scoping/Default.html">ActiveRecord::Scoping::Default</a>
  
    <li><a href="../../ActiveRecord/Scoping/Default/ClassMethods.html">ActiveRecord::Scoping::Default::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Scoping/Named.html">ActiveRecord::Scoping::Named</a>
  
    <li><a href="../../ActiveRecord/Scoping/Named/ClassMethods.html">ActiveRecord::Scoping::Named::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Serialization.html">ActiveRecord::Serialization</a>
  
    <li><a href="../../ActiveRecord/SerializationTypeMismatch.html">ActiveRecord::SerializationTypeMismatch</a>
  
    <li><a href="../../ActiveRecord/SessionStore.html">ActiveRecord::SessionStore</a>
  
    <li><a href="../../ActiveRecord/SessionStore/Session.html">ActiveRecord::SessionStore::Session</a>
  
    <li><a href="../../ActiveRecord/SessionStore/SqlBypass.html">ActiveRecord::SessionStore::SqlBypass</a>
  
    <li><a href="../../ActiveRecord/SpawnMethods.html">ActiveRecord::SpawnMethods</a>
  
    <li><a href="../../ActiveRecord/StaleObjectError.html">ActiveRecord::StaleObjectError</a>
  
    <li><a href="../../ActiveRecord/StatementInvalid.html">ActiveRecord::StatementInvalid</a>
  
    <li><a href="../../ActiveRecord/Store.html">ActiveRecord::Store</a>
  
    <li><a href="../../ActiveRecord/Store/ClassMethods.html">ActiveRecord::Store::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/TestFixtures.html">ActiveRecord::TestFixtures</a>
  
    <li><a href="../../ActiveRecord/TestFixtures/ClassMethods.html">ActiveRecord::TestFixtures::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/ThrowResult.html">ActiveRecord::ThrowResult</a>
  
    <li><a href="../../ActiveRecord/Timestamp.html">ActiveRecord::Timestamp</a>
  
    <li><a href="../../ActiveRecord/Transactions.html">ActiveRecord::Transactions</a>
  
    <li><a href="../../ActiveRecord/Transactions/ClassMethods.html">ActiveRecord::Transactions::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Translation.html">ActiveRecord::Translation</a>
  
    <li><a href="../../ActiveRecord/UnknownAttributeError.html">ActiveRecord::UnknownAttributeError</a>
  
    <li><a href="../../ActiveRecord/UnknownPrimaryKey.html">ActiveRecord::UnknownPrimaryKey</a>
  
    <li><a href="../../ActiveRecord/Validations.html">ActiveRecord::Validations</a>
  
    <li><a href="../../ActiveRecord/Validations/AssociatedValidator.html">ActiveRecord::Validations::AssociatedValidator</a>
  
    <li><a href="../../ActiveRecord/Validations/ClassMethods.html">ActiveRecord::Validations::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Validations/UniquenessValidator.html">ActiveRecord::Validations::UniquenessValidator</a>
  
    <li><a href="../../ActiveRecord/WrappedDatabaseException.html">ActiveRecord::WrappedDatabaseException</a>
  
    <li><a href="../../ActiveSupport.html">ActiveSupport</a>
  
    <li><a href="../../ActiveSupport/Autoload.html">ActiveSupport::Autoload</a>
  
    <li><a href="../../ActiveSupport/BacktraceCleaner.html">ActiveSupport::BacktraceCleaner</a>
  
    <li><a href="../../ActiveSupport/Base64.html">ActiveSupport::Base64</a>
  
    <li><a href="../../ActiveSupport/BasicObject.html">ActiveSupport::BasicObject</a>
  
    <li><a href="../../ActiveSupport/Benchmarkable.html">ActiveSupport::Benchmarkable</a>
  
    <li><a href="../../ActiveSupport/BufferedLogger.html">ActiveSupport::BufferedLogger</a>
  
    <li><a href="../../ActiveSupport/BufferedLogger/Severity.html">ActiveSupport::BufferedLogger::Severity</a>
  
    <li><a href="../../ActiveSupport/Cache.html">ActiveSupport::Cache</a>
  
    <li><a href="../../ActiveSupport/Cache/Entry.html">ActiveSupport::Cache::Entry</a>
  
    <li><a href="../../ActiveSupport/Cache/FileStore.html">ActiveSupport::Cache::FileStore</a>
  
    <li><a href="../../ActiveSupport/Cache/MemCacheStore.html">ActiveSupport::Cache::MemCacheStore</a>
  
    <li><a href="../../ActiveSupport/Cache/MemoryStore.html">ActiveSupport::Cache::MemoryStore</a>
  
    <li><a href="../../ActiveSupport/Cache/NullStore.html">ActiveSupport::Cache::NullStore</a>
  
    <li><a href="../../ActiveSupport/Cache/Store.html">ActiveSupport::Cache::Store</a>
  
    <li><a href="../../ActiveSupport/Cache/Strategy.html">ActiveSupport::Cache::Strategy</a>
  
    <li><a href="../../ActiveSupport/Cache/Strategy/LocalCache.html">ActiveSupport::Cache::Strategy::LocalCache</a>
  
    <li><a href="../../ActiveSupport/Cache/Strategy/LocalCache/LocalStore.html">ActiveSupport::Cache::Strategy::LocalCache::LocalStore</a>
  
    <li><a href="../../ActiveSupport/Callbacks.html">ActiveSupport::Callbacks</a>
  
    <li><a href="../../ActiveSupport/Callbacks/ClassMethods.html">ActiveSupport::Callbacks::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/Concern.html">ActiveSupport::Concern</a>
  
    <li><a href="../../ActiveSupport/Configurable.html">ActiveSupport::Configurable</a>
  
    <li><a href="../../ActiveSupport/Configurable/ClassMethods.html">ActiveSupport::Configurable::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/Configurable/Configuration.html">ActiveSupport::Configurable::Configuration</a>
  
    <li><a href="../../ActiveSupport/Dependencies.html">ActiveSupport::Dependencies</a>
  
    <li><a href="../../ActiveSupport/Dependencies/ClassCache.html">ActiveSupport::Dependencies::ClassCache</a>
  
    <li><a href="../../ActiveSupport/Dependencies/WatchStack.html">ActiveSupport::Dependencies::WatchStack</a>
  
    <li><a href="../../ActiveSupport/Deprecation.html">ActiveSupport::Deprecation</a>
  
    <li><a href="../../ActiveSupport/DescendantsTracker.html">ActiveSupport::DescendantsTracker</a>
  
    <li><a href="../../ActiveSupport/Duration.html">ActiveSupport::Duration</a>
  
    <li><a href="../../ActiveSupport/FileUpdateChecker.html">ActiveSupport::FileUpdateChecker</a>
  
    <li><a href="../../ActiveSupport/FileWatcher.html">ActiveSupport::FileWatcher</a>
  
    <li><a href="../../ActiveSupport/FileWatcher/Backend.html">ActiveSupport::FileWatcher::Backend</a>
  
    <li><a href="../../ActiveSupport/Gzip.html">ActiveSupport::Gzip</a>
  
    <li><a href="../../ActiveSupport/Gzip/Stream.html">ActiveSupport::Gzip::Stream</a>
  
    <li><a href="../../ActiveSupport/HashWithIndifferentAccess.html">ActiveSupport::HashWithIndifferentAccess</a>
  
    <li><a href="../../ActiveSupport/HashWithIndifferentAccess.html">ActiveSupport::HashWithIndifferentAccess</a>
  
    <li><a href="../../ActiveSupport/Inflector.html">ActiveSupport::Inflector</a>
  
    <li><a href="../../ActiveSupport/Inflector/Inflections.html">ActiveSupport::Inflector::Inflections</a>
  
    <li><a href="../../ActiveSupport/InheritableOptions.html">ActiveSupport::InheritableOptions</a>
  
    <li><a href="../../ActiveSupport/JSON.html">ActiveSupport::JSON</a>
  
    <li><a href="../../ActiveSupport/JSON/Encoding.html">ActiveSupport::JSON::Encoding</a>
  
    <li><a href="../../ActiveSupport/JSON/Encoding/CircularReferenceError.html">ActiveSupport::JSON::Encoding::CircularReferenceError</a>
  
    <li><a href="../../ActiveSupport/JSON/Encoding/Encoder.html">ActiveSupport::JSON::Encoding::Encoder</a>
  
    <li><a href="../../ActiveSupport/JSON/Variable.html">ActiveSupport::JSON::Variable</a>
  
    <li><a href="../../ActiveSupport/LogSubscriber.html">ActiveSupport::LogSubscriber</a>
  
    <li><a href="../../ActiveSupport/LogSubscriber/TestHelper.html">ActiveSupport::LogSubscriber::TestHelper</a>
  
    <li><a href="../../ActiveSupport/LogSubscriber/TestHelper/MockLogger.html">ActiveSupport::LogSubscriber::TestHelper::MockLogger</a>
  
    <li><a href="../../ActiveSupport/Memoizable.html">ActiveSupport::Memoizable</a>
  
    <li><a href="../../ActiveSupport/Memoizable/InstanceMethods.html">ActiveSupport::Memoizable::InstanceMethods</a>
  
    <li><a href="../../ActiveSupport/MessageEncryptor.html">ActiveSupport::MessageEncryptor</a>
  
    <li><a href="../../ActiveSupport/MessageEncryptor/InvalidMessage.html">ActiveSupport::MessageEncryptor::InvalidMessage</a>
  
    <li><a href="../../ActiveSupport/MessageVerifier.html">ActiveSupport::MessageVerifier</a>
  
    <li><a href="../../ActiveSupport/MessageVerifier/InvalidSignature.html">ActiveSupport::MessageVerifier::InvalidSignature</a>
  
    <li><a href="../../ActiveSupport/Multibyte.html">ActiveSupport::Multibyte</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Chars.html">ActiveSupport::Multibyte::Chars</a>
  
    <li><a href="../../ActiveSupport/Multibyte/EncodingError.html">ActiveSupport::Multibyte::EncodingError</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Unicode.html">ActiveSupport::Multibyte::Unicode</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Unicode/Codepoint.html">ActiveSupport::Multibyte::Unicode::Codepoint</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Unicode/UnicodeDatabase.html">ActiveSupport::Multibyte::Unicode::UnicodeDatabase</a>
  
    <li><a href="../../ActiveSupport/Notifications.html">ActiveSupport::Notifications</a>
  
    <li><a href="../../ActiveSupport/Notifications/Event.html">ActiveSupport::Notifications::Event</a>
  
    <li><a href="../../ActiveSupport/Notifications/Fanout.html">ActiveSupport::Notifications::Fanout</a>
  
    <li><a href="../../ActiveSupport/Notifications/Instrumenter.html">ActiveSupport::Notifications::Instrumenter</a>
  
    <li><a href="../../ActiveSupport/OrderedHash.html">ActiveSupport::OrderedHash</a>
  
    <li><a href="../../ActiveSupport/OrderedOptions.html">ActiveSupport::OrderedOptions</a>
  
    <li><a href="../../ActiveSupport/Railtie.html">ActiveSupport::Railtie</a>
  
    <li><a href="../../ActiveSupport/Rescuable.html">ActiveSupport::Rescuable</a>
  
    <li><a href="../../ActiveSupport/Rescuable/ClassMethods.html">ActiveSupport::Rescuable::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/SafeBuffer.html">ActiveSupport::SafeBuffer</a>
  
    <li><a href="../../ActiveSupport/SafeBuffer/SafeConcatError.html">ActiveSupport::SafeBuffer::SafeConcatError</a>
  
    <li><a href="../../ActiveSupport/StringInquirer.html">ActiveSupport::StringInquirer</a>
  
    <li><a href="../../ActiveSupport/TaggedLogging.html">ActiveSupport::TaggedLogging</a>
  
    <li><a href="../../ActiveSupport/TestCase.html">ActiveSupport::TestCase</a>
  
    <li><a href="../../ActiveSupport/Testing.html">ActiveSupport::Testing</a>
  
    <li><a href="../../ActiveSupport/Testing/Assertions.html">ActiveSupport::Testing::Assertions</a>
  
    <li><a href="../../ActiveSupport/Testing/Declarative.html">ActiveSupport::Testing::Declarative</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation.html">ActiveSupport::Testing::Isolation</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/Forking.html">ActiveSupport::Testing::Isolation::Forking</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/MiniTest.html">ActiveSupport::Testing::Isolation::MiniTest</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/Subprocess.html">ActiveSupport::Testing::Isolation::Subprocess</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/TestUnit.html">ActiveSupport::Testing::Isolation::TestUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/Pending.html">ActiveSupport::Testing::Pending</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance.html">ActiveSupport::Testing::Performance</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Benchmarker.html">ActiveSupport::Testing::Performance::Benchmarker</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/ForClassicTestUnit.html">ActiveSupport::Testing::Performance::ForClassicTestUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/ForMiniTest.html">ActiveSupport::Testing::Performance::ForMiniTest</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics.html">ActiveSupport::Testing::Performance::Metrics</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Amount.html">ActiveSupport::Testing::Performance::Metrics::Amount</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Base.html">ActiveSupport::Testing::Performance::Metrics::Base</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/CpuTime.html">ActiveSupport::Testing::Performance::Metrics::CpuTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/DigitalInformationUnit.html">ActiveSupport::Testing::Performance::Metrics::DigitalInformationUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/GcRuns.html">ActiveSupport::Testing::Performance::Metrics::GcRuns</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/GcTime.html">ActiveSupport::Testing::Performance::Metrics::GcTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Memory.html">ActiveSupport::Testing::Performance::Metrics::Memory</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Objects.html">ActiveSupport::Testing::Performance::Metrics::Objects</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/ProcessTime.html">ActiveSupport::Testing::Performance::Metrics::ProcessTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Time.html">ActiveSupport::Testing::Performance::Metrics::Time</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/UserTime.html">ActiveSupport::Testing::Performance::Metrics::UserTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/WallTime.html">ActiveSupport::Testing::Performance::Metrics::WallTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Performer.html">ActiveSupport::Testing::Performance::Performer</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Profiler.html">ActiveSupport::Testing::Performance::Profiler</a>
  
    <li><a href="../../ActiveSupport/Testing/ProxyTestResult.html">ActiveSupport::Testing::ProxyTestResult</a>
  
    <li><a href="../../ActiveSupport/Testing/RemoteError.html">ActiveSupport::Testing::RemoteError</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown.html">ActiveSupport::Testing::SetupAndTeardown</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown/ClassMethods.html">ActiveSupport::Testing::SetupAndTeardown::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown/ForClassicTestUnit.html">ActiveSupport::Testing::SetupAndTeardown::ForClassicTestUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown/ForMiniTest.html">ActiveSupport::Testing::SetupAndTeardown::ForMiniTest</a>
  
    <li><a href="../../ActiveSupport/TimeWithZone.html">ActiveSupport::TimeWithZone</a>
  
    <li><a href="../../ActiveSupport/TimeZone.html">ActiveSupport::TimeZone</a>
  
    <li><a href="../../ActiveSupport/XmlMini.html">ActiveSupport::XmlMini</a>
  
    <li><a href="../../ActiveSupport/XmlMini_LibXMLSAX.html">ActiveSupport::XmlMini_LibXMLSAX</a>
  
    <li><a href="../../ActiveSupport/XmlMini_LibXMLSAX/HashBuilder.html">ActiveSupport::XmlMini_LibXMLSAX::HashBuilder</a>
  
    <li><a href="../../ActiveSupport/XmlMini_NokogiriSAX.html">ActiveSupport::XmlMini_NokogiriSAX</a>
  
    <li><a href="../../ActiveSupport/XmlMini_NokogiriSAX/HashBuilder.html">ActiveSupport::XmlMini_NokogiriSAX::HashBuilder</a>
  
    <li><a href="../../ActionController.html">ActionController</a>
  
    <li><a href="../../ActionController/Base.html">ActionController::Base</a>
  
    <li><a href="../../ActionController/Caching.html">ActionController::Caching</a>
  
    <li><a href="../../ActionController/Caching/Actions.html">ActionController::Caching::Actions</a>
  
    <li><a href="../../ActionController/Caching/Actions/ActionCachePath.html">ActionController::Caching::Actions::ActionCachePath</a>
  
    <li><a href="../../ActionController/Caching/Actions/ClassMethods.html">ActionController::Caching::Actions::ClassMethods</a>
  
    <li><a href="../../ActionController/Caching/ConfigMethods.html">ActionController::Caching::ConfigMethods</a>
  
    <li><a href="../../ActionController/Caching/Fragments.html">ActionController::Caching::Fragments</a>
  
    <li><a href="../../ActionController/Caching/Pages.html">ActionController::Caching::Pages</a>
  
    <li><a href="../../ActionController/Caching/Pages/ClassMethods.html">ActionController::Caching::Pages::ClassMethods</a>
  
    <li><a href="../../ActionController/Caching/Sweeping.html">ActionController::Caching::Sweeping</a>
  
    <li><a href="../../ActionController/Compatibility.html">ActionController::Compatibility</a>
  
    <li><a href="../../ActionController/ConditionalGet.html">ActionController::ConditionalGet</a>
  
    <li><a href="../../ActionController/Cookies.html">ActionController::Cookies</a>
  
    <li><a href="../../ActionController/DataStreaming.html">ActionController::DataStreaming</a>
  
    <li><a href="../../ActionController/Flash.html">ActionController::Flash</a>
  
    <li><a href="../../ActionController/ForceSSL.html">ActionController::ForceSSL</a>
  
    <li><a href="../../ActionController/ForceSSL/ClassMethods.html">ActionController::ForceSSL::ClassMethods</a>
  
    <li><a href="../../ActionController/Head.html">ActionController::Head</a>
  
    <li><a href="../../ActionController/Helpers.html">ActionController::Helpers</a>
  
    <li><a href="../../ActionController/Helpers/ClassMethods.html">ActionController::Helpers::ClassMethods</a>
  
    <li><a href="../../ActionController/HideActions.html">ActionController::HideActions</a>
  
    <li><a href="../../ActionController/HideActions/ClassMethods.html">ActionController::HideActions::ClassMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication.html">ActionController::HttpAuthentication</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Basic.html">ActionController::HttpAuthentication::Basic</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Basic/ControllerMethods.html">ActionController::HttpAuthentication::Basic::ControllerMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Basic/ControllerMethods/ClassMethods.html">ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Digest.html">ActionController::HttpAuthentication::Digest</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Digest/ControllerMethods.html">ActionController::HttpAuthentication::Digest::ControllerMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Token.html">ActionController::HttpAuthentication::Token</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Token/ControllerMethods.html">ActionController::HttpAuthentication::Token::ControllerMethods</a>
  
    <li><a href="../../ActionController/ImplicitRender.html">ActionController::ImplicitRender</a>
  
    <li><a href="../../ActionController/Instrumentation.html">ActionController::Instrumentation</a>
  
    <li><a href="../../ActionController/Instrumentation/ClassMethods.html">ActionController::Instrumentation::ClassMethods</a>
  
    <li><a href="../../ActionController/LogSubscriber.html">ActionController::LogSubscriber</a>
  
    <li><a href="../../ActionController/Metal.html">ActionController::Metal</a>
  
    <li><a href="../../ActionController/Middleware.html">ActionController::Middleware</a>
  
    <li><a href="../../ActionController/Middleware/ActionMiddleware.html">ActionController::Middleware::ActionMiddleware</a>
  
    <li><a href="../../ActionController/MimeResponds.html">ActionController::MimeResponds</a>
  
    <li><a href="../../ActionController/MimeResponds/ClassMethods.html">ActionController::MimeResponds::ClassMethods</a>
  
    <li><a href="../../ActionController/ParamsWrapper.html">ActionController::ParamsWrapper</a>
  
    <li><a href="../../ActionController/ParamsWrapper/ClassMethods.html">ActionController::ParamsWrapper::ClassMethods</a>
  
    <li><a href="../../ActionController/RackDelegation.html">ActionController::RackDelegation</a>
  
    <li><a href="../../ActionController/Railtie.html">ActionController::Railtie</a>
  
    <li><a href="../../ActionController/Railties.html">ActionController::Railties</a>
  
    <li><a href="../../ActionController/Railties/Paths.html">ActionController::Railties::Paths</a>
  
    <li><a href="../../ActionController/RecordIdentifier.html">ActionController::RecordIdentifier</a>
  
    <li><a href="../../ActionController/Redirecting.html">ActionController::Redirecting</a>
  
    <li><a href="../../ActionController/Renderers.html">ActionController::Renderers</a>
  
    <li><a href="../../ActionController/Renderers/All.html">ActionController::Renderers::All</a>
  
    <li><a href="../../ActionController/Renderers/ClassMethods.html">ActionController::Renderers::ClassMethods</a>
  
    <li><a href="../../ActionController/Rendering.html">ActionController::Rendering</a>
  
    <li><a href="../../ActionController/RequestForgeryProtection.html">ActionController::RequestForgeryProtection</a>
  
    <li><a href="../../ActionController/RequestForgeryProtection/ClassMethods.html">ActionController::RequestForgeryProtection::ClassMethods</a>
  
    <li><a href="../../ActionController/Rescue.html">ActionController::Rescue</a>
  
    <li><a href="../../ActionController/Responder.html">ActionController::Responder</a>
  
    <li><a href="../../ActionController/SessionManagement.html">ActionController::SessionManagement</a>
  
    <li><a href="../../ActionController/SessionManagement/ClassMethods.html">ActionController::SessionManagement::ClassMethods</a>
  
    <li><a href="../../ActionController/Streaming.html">ActionController::Streaming</a>
  
    <li><a href="../../ActionController/TemplateAssertions.html">ActionController::TemplateAssertions</a>
  
    <li><a href="../../ActionController/TestCase.html">ActionController::TestCase</a>
  
    <li><a href="../../ActionController/TestCase/Behavior.html">ActionController::TestCase::Behavior</a>
  
    <li><a href="../../ActionController/TestCase/Behavior/ClassMethods.html">ActionController::TestCase::Behavior::ClassMethods</a>
  
    <li><a href="../../ActionController/TestCase/RaiseActionExceptions.html">ActionController::TestCase::RaiseActionExceptions</a>
  
    <li><a href="../../ActionController/TestResponse.html">ActionController::TestResponse</a>
  
    <li><a href="../../ActionController/Testing.html">ActionController::Testing</a>
  
    <li><a href="../../ActionController/Testing/ClassMethods.html">ActionController::Testing::ClassMethods</a>
  
    <li><a href="../../ActionController/UrlFor.html">ActionController::UrlFor</a>
  
    <li><a href="../../ActionView.html">ActionView</a>
  
    <li><a href="../../ActionView/ActionView.html">ActionView::ActionView</a>
  
    <li><a href="../../ActionView/ActionView/ActionView.html">ActionView::ActionView::ActionView</a>
  
    <li><a href="../../ActionView/ActionView/ActionView/Base.html">ActionView::ActionView::ActionView::Base</a>
  
    <li><a href="../../ActionView/Base.html">ActionView::Base</a>
  
    <li><a href="../../ActionView/Context.html">ActionView::Context</a>
  
    <li><a href="../../ActionView/FileSystemResolver.html">ActionView::FileSystemResolver</a>
  
    <li><a href="../../ActionView/FixtureResolver.html">ActionView::FixtureResolver</a>
  
    <li><a href="../../ActionView/Helpers.html">ActionView::Helpers</a>
  
    <li><a href="../../ActionView/Helpers/ActiveModelHelper.html">ActionView::Helpers::ActiveModelHelper</a>
  
    <li><a href="../../ActionView/Helpers/ActiveModelInstanceTag.html">ActionView::Helpers::ActiveModelInstanceTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper.html">ActionView::Helpers::AssetTagHelper</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/AssetIncludeTag.html">ActionView::Helpers::AssetTagHelper::AssetIncludeTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/JavascriptIncludeTag.html">ActionView::Helpers::AssetTagHelper::JavascriptIncludeTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/JavascriptTagHelpers.html">ActionView::Helpers::AssetTagHelper::JavascriptTagHelpers</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/JavascriptTagHelpers/ClassMethods.html">ActionView::Helpers::AssetTagHelper::JavascriptTagHelpers::ClassMethods</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/StylesheetIncludeTag.html">ActionView::Helpers::AssetTagHelper::StylesheetIncludeTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/StylesheetTagHelpers.html">ActionView::Helpers::AssetTagHelper::StylesheetTagHelpers</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/StylesheetTagHelpers/ClassMethods.html">ActionView::Helpers::AssetTagHelper::StylesheetTagHelpers::ClassMethods</a>
  
    <li><a href="../../ActionView/Helpers/AtomFeedHelper.html">ActionView::Helpers::AtomFeedHelper</a>
  
    <li><a href="../../ActionView/Helpers/AtomFeedHelper/AtomBuilder.html">ActionView::Helpers::AtomFeedHelper::AtomBuilder</a>
  
    <li><a href="../../ActionView/Helpers/AtomFeedHelper/AtomFeedBuilder.html">ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder</a>
  
    <li><a href="../../ActionView/Helpers/CacheHelper.html">ActionView::Helpers::CacheHelper</a>
  
    <li><a href="../../ActionView/Helpers/CaptureHelper.html">ActionView::Helpers::CaptureHelper</a>
  
    <li><a href="../../ActionView/Helpers/CsrfHelper.html">ActionView::Helpers::CsrfHelper</a>
  
    <li><a href="../../ActionView/Helpers/DateHelper.html">ActionView::Helpers::DateHelper</a>
  
    <li><a href="../../ActionView/Helpers/DateHelperInstanceTag.html">ActionView::Helpers::DateHelperInstanceTag</a>
  
    <li><a href="../../ActionView/Helpers/DebugHelper.html">ActionView::Helpers::DebugHelper</a>
  
    <li><a href="../../ActionView/Helpers/FormBuilder.html">ActionView::Helpers::FormBuilder</a>
  
    <li><a href="../../ActionView/Helpers/FormHelper.html">ActionView::Helpers::FormHelper</a>
  
    <li><a href="../../ActionView/Helpers/FormOptionsHelper.html">ActionView::Helpers::FormOptionsHelper</a>
  
    <li><a href="../../ActionView/Helpers/FormTagHelper.html">ActionView::Helpers::FormTagHelper</a>
  
    <li><a href="../../ActionView/Helpers/InstanceTag.html">ActionView::Helpers::InstanceTag</a>
  
    <li><a href="../../ActionView/Helpers/JavaScriptHelper.html">ActionView::Helpers::JavaScriptHelper</a>
  
    <li><a href="../../ActionView/Helpers/NumberHelper.html">ActionView::Helpers::NumberHelper</a>
  
    <li><a href="../../ActionView/Helpers/NumberHelper/InvalidNumberError.html">ActionView::Helpers::NumberHelper::InvalidNumberError</a>
  
    <li><a href="../../ActionView/Helpers/OutputSafetyHelper.html">ActionView::Helpers::OutputSafetyHelper</a>
  
    <li><a href="../../ActionView/Helpers/RecordTagHelper.html">ActionView::Helpers::RecordTagHelper</a>
  
    <li><a href="../../ActionView/Helpers/RenderingHelper.html">ActionView::Helpers::RenderingHelper</a>
  
    <li><a href="../../ActionView/Helpers/SanitizeHelper.html">ActionView::Helpers::SanitizeHelper</a>
  
    <li><a href="../../ActionView/Helpers/TagHelper.html">ActionView::Helpers::TagHelper</a>
  
    <li><a href="../../ActionView/Helpers/TextHelper.html">ActionView::Helpers::TextHelper</a>
  
    <li><a href="../../ActionView/Helpers/TranslationHelper.html">ActionView::Helpers::TranslationHelper</a>
  
    <li><a href="../../ActionView/Helpers/UrlHelper.html">ActionView::Helpers::UrlHelper</a>
  
    <li><a href="../../ActionView/LogSubscriber.html">ActionView::LogSubscriber</a>
  
    <li><a href="../../ActionView/LookupContext.html">ActionView::LookupContext</a>
  
    <li><a href="../../ActionView/LookupContext/DetailsCache.html">ActionView::LookupContext::DetailsCache</a>
  
    <li><a href="../../ActionView/LookupContext/ViewPaths.html">ActionView::LookupContext::ViewPaths</a>
  
    <li><a href="../../ActionView/NullResolver.html">ActionView::NullResolver</a>
  
    <li><a href="../../ActionView/PartialRenderer.html">ActionView::PartialRenderer</a>
  
    <li><a href="../../ActionView/Railtie.html">ActionView::Railtie</a>
  
    <li><a href="../../ActionView/Renderer.html">ActionView::Renderer</a>
  
    <li><a href="../../ActionView/Resolver.html">ActionView::Resolver</a>
  
    <li><a href="../../ActionView/Resolver/Path.html">ActionView::Resolver::Path</a>
  
    <li><a href="../../ActionView/Template.html">ActionView::Template</a>
  
    <li><a href="../../ActionView/Template/Handlers.html">ActionView::Template::Handlers</a>
  
    <li><a href="../../ActionView/Template/Handlers/Builder.html">ActionView::Template::Handlers::Builder</a>
  
    <li><a href="../../ActionView/Template/Handlers/ERB.html">ActionView::Template::Handlers::ERB</a>
  
    <li><a href="../../ActionView/Template/Handlers/Erubis.html">ActionView::Template::Handlers::Erubis</a>
  
    <li><a href="../../ActionView/TestCase.html">ActionView::TestCase</a>
  
    <li><a href="../../ActionView/TestCase/Behavior.html">ActionView::TestCase::Behavior</a>
  
    <li><a href="../../ActionView/TestCase/Behavior/ClassMethods.html">ActionView::TestCase::Behavior::ClassMethods</a>
  
    <li><a href="../../ActionView/TestCase/Behavior/Locals.html">ActionView::TestCase::Behavior::Locals</a>
  
    <li><a href="../../ActionView/TestCase/TestController.html">ActionView::TestCase::TestController</a>
  
    <li><a href="../../ActiveModel.html">ActiveModel</a>
  
    <li><a href="../../ActiveModel/AttributeMethods.html">ActiveModel::AttributeMethods</a>
  
    <li><a href="../../ActiveModel/AttributeMethods/ClassMethods.html">ActiveModel::AttributeMethods::ClassMethods</a>
  
    <li><a href="../../ActiveModel/AttributeMethods/ClassMethods/AttributeMethodMatcher.html">ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher</a>
  
    <li><a href="../../ActiveModel/BlockValidator.html">ActiveModel::BlockValidator</a>
  
    <li><a href="../../ActiveModel/Callbacks.html">ActiveModel::Callbacks</a>
  
    <li><a href="../../ActiveModel/Conversion.html">ActiveModel::Conversion</a>
  
    <li><a href="../../ActiveModel/Dirty.html">ActiveModel::Dirty</a>
  
    <li><a href="../../ActiveModel/EachValidator.html">ActiveModel::EachValidator</a>
  
    <li><a href="../../ActiveModel/Errors.html">ActiveModel::Errors</a>
  
    <li><a href="../../ActiveModel/Lint.html">ActiveModel::Lint</a>
  
    <li><a href="../../ActiveModel/Lint/Tests.html">ActiveModel::Lint::Tests</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity.html">ActiveModel::MassAssignmentSecurity</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/BlackList.html">ActiveModel::MassAssignmentSecurity::BlackList</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/ClassMethods.html">ActiveModel::MassAssignmentSecurity::ClassMethods</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/Error.html">ActiveModel::MassAssignmentSecurity::Error</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/LoggerSanitizer.html">ActiveModel::MassAssignmentSecurity::LoggerSanitizer</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/PermissionSet.html">ActiveModel::MassAssignmentSecurity::PermissionSet</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/Sanitizer.html">ActiveModel::MassAssignmentSecurity::Sanitizer</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/StrictSanitizer.html">ActiveModel::MassAssignmentSecurity::StrictSanitizer</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/WhiteList.html">ActiveModel::MassAssignmentSecurity::WhiteList</a>
  
    <li><a href="../../ActiveModel/MissingAttributeError.html">ActiveModel::MissingAttributeError</a>
  
    <li><a href="../../ActiveModel/Name.html">ActiveModel::Name</a>
  
    <li><a href="../../ActiveModel/Naming.html">ActiveModel::Naming</a>
  
    <li><a href="../../ActiveModel/Observer.html">ActiveModel::Observer</a>
  
    <li><a href="../../ActiveModel/ObserverArray.html">ActiveModel::ObserverArray</a>
  
    <li><a href="../../ActiveModel/Observing.html">ActiveModel::Observing</a>
  
    <li><a href="../../ActiveModel/Observing/ClassMethods.html">ActiveModel::Observing::ClassMethods</a>
  
    <li><a href="../../ActiveModel/SecurePassword.html">ActiveModel::SecurePassword</a>
  
    <li><a href="../../ActiveModel/SecurePassword/ClassMethods.html">ActiveModel::SecurePassword::ClassMethods</a>
  
    <li><a href="../../ActiveModel/SecurePassword/InstanceMethodsOnActivation.html">ActiveModel::SecurePassword::InstanceMethodsOnActivation</a>
  
    <li><a href="../../ActiveModel/Serialization.html">ActiveModel::Serialization</a>
  
    <li><a href="../../ActiveModel/Serializers.html">ActiveModel::Serializers</a>
  
    <li><a href="../../ActiveModel/Serializers/JSON.html">ActiveModel::Serializers::JSON</a>
  
    <li><a href="../../ActiveModel/Serializers/Xml.html">ActiveModel::Serializers::Xml</a>
  
    <li><a href="../../ActiveModel/StrictValidationFailed.html">ActiveModel::StrictValidationFailed</a>
  
    <li><a href="../../ActiveModel/Translation.html">ActiveModel::Translation</a>
  
    <li><a href="../../ActiveModel/Validations.html">ActiveModel::Validations</a>
  
    <li><a href="../../ActiveModel/Validations/AcceptanceValidator.html">ActiveModel::Validations::AcceptanceValidator</a>
  
    <li><a href="../../ActiveModel/Validations/Callbacks.html">ActiveModel::Validations::Callbacks</a>
  
    <li><a href="../../ActiveModel/Validations/Callbacks/ClassMethods.html">ActiveModel::Validations::Callbacks::ClassMethods</a>
  
    <li><a href="../../ActiveModel/Validations/ClassMethods.html">ActiveModel::Validations::ClassMethods</a>
  
    <li><a href="../../ActiveModel/Validations/ConfirmationValidator.html">ActiveModel::Validations::ConfirmationValidator</a>
  
    <li><a href="../../ActiveModel/Validations/ExclusionValidator.html">ActiveModel::Validations::ExclusionValidator</a>
  
    <li><a href="../../ActiveModel/Validations/FormatValidator.html">ActiveModel::Validations::FormatValidator</a>
  
    <li><a href="../../ActiveModel/Validations/HelperMethods.html">ActiveModel::Validations::HelperMethods</a>
  
    <li><a href="../../ActiveModel/Validations/InclusionValidator.html">ActiveModel::Validations::InclusionValidator</a>
  
    <li><a href="../../ActiveModel/Validations/LengthValidator.html">ActiveModel::Validations::LengthValidator</a>
  
    <li><a href="../../ActiveModel/Validations/NumericalityValidator.html">ActiveModel::Validations::NumericalityValidator</a>
  
    <li><a href="../../ActiveModel/Validations/PresenceValidator.html">ActiveModel::Validations::PresenceValidator</a>
  
    <li><a href="../../ActiveModel/Validations/WithValidator.html">ActiveModel::Validations::WithValidator</a>
  
    <li><a href="../../ActiveModel/Validator.html">ActiveModel::Validator</a>
  
    <li><a href="../../ActiveResource.html">ActiveResource</a>
  
    <li><a href="../../ActiveResource/Base.html">ActiveResource::Base</a>
  
    <li><a href="../../ActiveResource/Connection.html">ActiveResource::Connection</a>
  
    <li><a href="../../ActiveResource/CustomMethods.html">ActiveResource::CustomMethods</a>
  
    <li><a href="../../ActiveResource/CustomMethods/ClassMethods.html">ActiveResource::CustomMethods::ClassMethods</a>
  
    <li><a href="../../ActiveResource/Errors.html">ActiveResource::Errors</a>
  
    <li><a href="../../ActiveResource/Formats.html">ActiveResource::Formats</a>
  
    <li><a href="../../ActiveResource/Formats/JsonFormat.html">ActiveResource::Formats::JsonFormat</a>
  
    <li><a href="../../ActiveResource/Formats/XmlFormat.html">ActiveResource::Formats::XmlFormat</a>
  
    <li><a href="../../ActiveResource/HttpMock.html">ActiveResource::HttpMock</a>
  
    <li><a href="../../ActiveResource/InvalidRequestError.html">ActiveResource::InvalidRequestError</a>
  
    <li><a href="../../ActiveResource/LogSubscriber.html">ActiveResource::LogSubscriber</a>
  
    <li><a href="../../ActiveResource/Observing.html">ActiveResource::Observing</a>
  
    <li><a href="../../ActiveResource/Railtie.html">ActiveResource::Railtie</a>
  
    <li><a href="../../ActiveResource/Request.html">ActiveResource::Request</a>
  
    <li><a href="../../ActiveResource/Response.html">ActiveResource::Response</a>
  
    <li><a href="../../ActiveResource/SSLError.html">ActiveResource::SSLError</a>
  
    <li><a href="../../ActiveResource/TimeoutError.html">ActiveResource::TimeoutError</a>
  
    <li><a href="../../ActiveResource/Validations.html">ActiveResource::Validations</a>
  
    <li><a href="../../HTML.html">HTML</a>
  
    <li><a href="../../HTML/FullSanitizer.html">HTML::FullSanitizer</a>
  
    <li><a href="../../HTML/LinkSanitizer.html">HTML::LinkSanitizer</a>
  
    <li><a href="../../HTML/Sanitizer.html">HTML::Sanitizer</a>
  
    <li><a href="../../HTML/Selector.html">HTML::Selector</a>
  
    <li><a href="../../HTML/Tag.html">HTML::Tag</a>
  
    <li><a href="../../HTML/WhiteListSanitizer.html">HTML::WhiteListSanitizer</a>
  
    <li><a href="../../Mysql.html">Mysql</a>
  
    <li><a href="../../Mysql/Result.html">Mysql::Result</a>
  
    <li><a href="../../Mysql/Stmt.html">Mysql::Stmt</a>
  
    <li><a href="../../Mysql/Time.html">Mysql::Time</a>
  
    <li><a href="../../Test.html">Test</a>
  
    <li><a href="../../Test/Unit.html">Test::Unit</a>
  
    <li><a href="../../Test/Unit/Collector.html">Test::Unit::Collector</a>
  
    <li><a href="../../Test/Unit/Collector/ObjectSpace.html">Test::Unit::Collector::ObjectSpace</a>
  
    <li><a href="../../I18n.html">I18n</a>
  
    <li><a href="../../I18n/ExceptionHandler.html">I18n::ExceptionHandler</a>
  
    <li><a href="../../I18n/Railtie.html">I18n::Railtie</a>
  
    <li><a href="../../Object.html">Object</a>
  
    <li><a href="../../ActiveSupport/HashWithIndifferentAccess.html">Object::HashWithIndifferentAccess</a>
  
    <li><a href="../../LoadError.html">Object::MissingSourceFile</a>
  
    <li><a href="../../ActionMailer.html">ActionMailer</a>
  
    <li><a href="../../ActionMailer/Base.html">ActionMailer::Base</a>
  
    <li><a href="../../ArJdbcMySQL.html">ArJdbcMySQL</a>
  
    <li><a href="../../ArJdbcMySQL/Error.html">ArJdbcMySQL::Error</a>
  
    <li><a href="../../ERB.html">ERB</a>
  
    <li><a href="../../ERB/Util.html">ERB::Util</a>
  
    <li><a href="../../LoadError.html">LoadError</a>
  
    <li><a href="../../LoadError.html">LoadError</a>
  
    <li><a href="../../Logger.html">Logger</a>
  
    <li><a href="../../Logger/SimpleFormatter.html">Logger::SimpleFormatter</a>
  
    <li><a href="../../Array.html">Array</a>
  
    <li><a href="../../Base64.html">Base64</a>
  
    <li><a href="../../Benchmark.html">Benchmark</a>
  
    <li><a href="../../BigDecimal.html">BigDecimal</a>
  
    <li><a href="../../Class.html">Class</a>
  
    <li><a href="../../Date.html">Date</a>
  
    <li><a href="../../DateTime.html">DateTime</a>
  
    <li><a href="../../Enumerable.html">Enumerable</a>
  
    <li><a href="../../FalseClass.html">FalseClass</a>
  
    <li><a href="../../File.html">File</a>
  
    <li><a href="../../Float.html">Float</a>
  
    <li><a href="../../Hash.html">Hash</a>
  
    <li><a href="../../Integer.html">Integer</a>
  
    <li><a href="../../Kernel.html">Kernel</a>
  
    <li><a href="../../Module.html">Module</a>
  
    <li><a href="../../NameError.html">NameError</a>
  
    <li><a href="../../NilClass.html">NilClass</a>
  
    <li><a href="../../Numeric.html">Numeric</a>
  
    <li><a href="../../Process.html">Process</a>
  
    <li><a href="../../QualifiedConstUtils.html">QualifiedConstUtils</a>
  
    <li><a href="../../Rails.html">Rails</a>
  
    <li><a href="../../Range.html">Range</a>
  
    <li><a href="../../Regexp.html">Regexp</a>
  
    <li><a href="../../String.html">String</a>
  
    <li><a href="../../Symbol.html">Symbol</a>
  
    <li><a href="../../Time.html">Time</a>
  
    <li><a href="../../TrueClass.html">TrueClass</a>
  
    <li><a href="../../URI.html">URI</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="module">module ActionView::Helpers::FormHelper</h1>

  <div id="description" class="description">
    
<p>Form helpers are designed to make working with resources much easier
compared to using vanilla <a href="../../HTML.html">HTML</a>.</p>

<p>Forms for models are created with <code>form_for</code>. That method yields
a form builder that knows the model the form is about. The form builder is
thus able to generate default values for input fields that correspond to
model attributes, and also convenient names, IDs, endpoints, etc.</p>

<p>Conventions in the generated field names allow controllers to receive form
data nicely structured in <code>params</code> with no effort on your side.</p>

<p>For example, to create a new person you typically set up a new instance of
<code>Person</code> in the <code>PeopleController#new</code> action,
<code>@person</code>, and pass it to <code>form_for</code>:</p>

<pre>&lt;%= form_for @person do |f| %&gt;
  &lt;%= f.label :first_name %&gt;:
  &lt;%= f.text_field :first_name %&gt;&lt;br /&gt;

  &lt;%= f.label :last_name %&gt;:
  &lt;%= f.text_field :last_name %&gt;&lt;br /&gt;

  &lt;%= f.submit %&gt;
&lt;% end %&gt;</pre>

<p>The <a href="../../HTML.html">HTML</a> generated for this would be (modulus
formatting):</p>

<pre class="ruby"><span class="ruby-operator">&lt;</span><span class="ruby-identifier">form</span> <span class="ruby-identifier">action</span>=<span class="ruby-string">&quot;/people&quot;</span> <span class="ruby-keyword">class</span>=<span class="ruby-string">&quot;new_person&quot;</span> <span class="ruby-identifier">id</span>=<span class="ruby-string">&quot;new_person&quot;</span> <span class="ruby-identifier">method</span>=<span class="ruby-string">&quot;post&quot;</span><span class="ruby-operator">&gt;</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-identifier">div</span> <span class="ruby-identifier">style</span>=<span class="ruby-string">&quot;margin:0;padding:0;display:inline&quot;</span><span class="ruby-operator">&gt;</span>
    <span class="ruby-operator">&lt;</span><span class="ruby-identifier">input</span> <span class="ruby-identifier">name</span>=<span class="ruby-string">&quot;authenticity_token&quot;</span> <span class="ruby-identifier">type</span>=<span class="ruby-string">&quot;hidden&quot;</span> <span class="ruby-identifier">value</span>=<span class="ruby-string">&quot;NrOp5bsjoLRuK8IW5+dQEYjKGUJDe7TQoZVvq95Wteg=&quot;</span> <span class="ruby-operator">/</span><span class="ruby-operator">&gt;</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-regexp">%rdiv&gt;
  &lt;label for=&quot;person_first_name&quot;&gt;First name&lt;/</span><span class="ruby-identifier">label</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">:</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-identifier">input</span> <span class="ruby-identifier">id</span>=<span class="ruby-string">&quot;person_first_name&quot;</span> <span class="ruby-identifier">name</span>=<span class="ruby-string">&quot;person[first_name]&quot;</span> <span class="ruby-identifier">size</span>=<span class="ruby-string">&quot;30&quot;</span> <span class="ruby-identifier">type</span>=<span class="ruby-string">&quot;text&quot;</span> <span class="ruby-operator">/</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">br</span> <span class="ruby-regexp">%r&gt;

  &lt;label for=&quot;person_last_name&quot;&gt;Last name&lt;/</span><span class="ruby-identifier">label</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">:</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-identifier">input</span> <span class="ruby-identifier">id</span>=<span class="ruby-string">&quot;person_last_name&quot;</span> <span class="ruby-identifier">name</span>=<span class="ruby-string">&quot;person[last_name]&quot;</span> <span class="ruby-identifier">size</span>=<span class="ruby-string">&quot;30&quot;</span> <span class="ruby-identifier">type</span>=<span class="ruby-string">&quot;text&quot;</span> <span class="ruby-operator">/</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">br</span> <span class="ruby-regexp">%r&gt;

  &lt;input name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Create Person&quot; /</span><span class="ruby-operator">&gt;</span>
<span class="ruby-operator">&lt;</span><span class="ruby-regexp">%rform&gt;
</span></pre>

<p>As you see, the <a href="../../HTML.html">HTML</a> reflects knowledge about
the resource in several spots, like the path the form should be submitted
to, or the names of the input fields.</p>

<p>In particular, thanks to the conventions followed in the generated field
names, the controller gets a nested hash <code>params[:person]</code> with
the person attributes set in the form. That hash is ready to be passed to
<code>Person.create</code>:</p>

<pre>if @person = Person.create(params[:person])
  # success
else
  # error handling
end</pre>

<p>Interestingly, the exact same view code in the previous example can be used
to edit a person. If <code>@person</code> is an existing record with name
“John Smith” and ID 256, the code above as is would yield instead:</p>

<pre class="ruby"><span class="ruby-operator">&lt;</span><span class="ruby-identifier">form</span> <span class="ruby-identifier">action</span>=<span class="ruby-string">&quot;/people/256&quot;</span> <span class="ruby-keyword">class</span>=<span class="ruby-string">&quot;edit_person&quot;</span> <span class="ruby-identifier">id</span>=<span class="ruby-string">&quot;edit_person_256&quot;</span> <span class="ruby-identifier">method</span>=<span class="ruby-string">&quot;post&quot;</span><span class="ruby-operator">&gt;</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-identifier">div</span> <span class="ruby-identifier">style</span>=<span class="ruby-string">&quot;margin:0;padding:0;display:inline&quot;</span><span class="ruby-operator">&gt;</span>
    <span class="ruby-operator">&lt;</span><span class="ruby-identifier">input</span> <span class="ruby-identifier">name</span>=<span class="ruby-string">&quot;_method&quot;</span> <span class="ruby-identifier">type</span>=<span class="ruby-string">&quot;hidden&quot;</span> <span class="ruby-identifier">value</span>=<span class="ruby-string">&quot;put&quot;</span> <span class="ruby-operator">/</span><span class="ruby-operator">&gt;</span>
    <span class="ruby-operator">&lt;</span><span class="ruby-identifier">input</span> <span class="ruby-identifier">name</span>=<span class="ruby-string">&quot;authenticity_token&quot;</span> <span class="ruby-identifier">type</span>=<span class="ruby-string">&quot;hidden&quot;</span> <span class="ruby-identifier">value</span>=<span class="ruby-string">&quot;NrOp5bsjoLRuK8IW5+dQEYjKGUJDe7TQoZVvq95Wteg=&quot;</span> <span class="ruby-operator">/</span><span class="ruby-operator">&gt;</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-regexp">%rdiv&gt;
  &lt;label for=&quot;person_first_name&quot;&gt;First name&lt;/</span><span class="ruby-identifier">label</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">:</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-identifier">input</span> <span class="ruby-identifier">id</span>=<span class="ruby-string">&quot;person_first_name&quot;</span> <span class="ruby-identifier">name</span>=<span class="ruby-string">&quot;person[first_name]&quot;</span> <span class="ruby-identifier">size</span>=<span class="ruby-string">&quot;30&quot;</span> <span class="ruby-identifier">type</span>=<span class="ruby-string">&quot;text&quot;</span> <span class="ruby-identifier">value</span>=<span class="ruby-string">&quot;John&quot;</span> <span class="ruby-operator">/</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">br</span> <span class="ruby-regexp">%r&gt;

  &lt;label for=&quot;person_last_name&quot;&gt;Last name&lt;/</span><span class="ruby-identifier">label</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">:</span>
  <span class="ruby-operator">&lt;</span><span class="ruby-identifier">input</span> <span class="ruby-identifier">id</span>=<span class="ruby-string">&quot;person_last_name&quot;</span> <span class="ruby-identifier">name</span>=<span class="ruby-string">&quot;person[last_name]&quot;</span> <span class="ruby-identifier">size</span>=<span class="ruby-string">&quot;30&quot;</span> <span class="ruby-identifier">type</span>=<span class="ruby-string">&quot;text&quot;</span> <span class="ruby-identifier">value</span>=<span class="ruby-string">&quot;Smith&quot;</span> <span class="ruby-operator">/</span><span class="ruby-operator">&gt;</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">br</span> <span class="ruby-regexp">%r&gt;

  &lt;input name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Update Person&quot; /</span><span class="ruby-operator">&gt;</span>
<span class="ruby-operator">&lt;</span><span class="ruby-regexp">%rform&gt;
</span></pre>

<p>Note that the endpoint, default values, and submit button label are
tailored for <code>@person</code>. That works that way because the involved
helpers know whether the resource is a new record or not, and generate <a
href="../../HTML.html">HTML</a> accordingly.</p>

<p>The controller would receive the form data again in
<code>params[:person]</code>, ready to be passed to
<code>Person#update_attributes</code>:</p>

<pre>if @person.update_attributes(params[:person])
  # success
else
  # error handling
end</pre>

<p>That’s how you typically work with resources.</p>

  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    <!-- Methods -->
    
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-check_box" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">check_box</span><span
            class="method-args">(object_name, method, options = {}, checked_value = "1", unchecked_value = "0")</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a checkbox tag tailored for accessing a specified attribute
(identified by <code>method</code>) on an object assigned to the template
(identified by <code>object</code>). This object must be an instance object
(@object) and not a local object. It’s intended that <code>method</code>
returns an integer and if that integer is above zero, then the checkbox is
checked. Additional options on the input tag can be passed as a hash with
<code>options</code>. The <code>checked_value</code> defaults to 1 while
the default <code>unchecked_value</code> is set to 0 which is convenient
for boolean values.</p>

<h4 id="method-i-check_box-label-Gotcha">Gotcha</h4>

<p>The <a href="../../HTML.html">HTML</a> specification says unchecked check
boxes are not successful, and thus web browsers do not send them.
Unfortunately this introduces a gotcha: if an <code>Invoice</code> model
has a <code>paid</code> flag, and in the form that edits a paid invoice the
user unchecks its check box, no <code>paid</code> parameter is sent. So,
any mass-assignment idiom like</p>

<pre>@invoice.update_attributes(params[:invoice])</pre>

<p>wouldn’t update the flag.</p>

<p>To prevent this the helper generates an auxiliary hidden field before the
very check box. The hidden field has the same name and its attributes mimic
an unchecked check box.</p>

<p>This way, the client either sends only the hidden field (representing the
check box is unchecked), or both fields. Since the <a
href="../../HTML.html">HTML</a> specification says key/value pairs have to
be sent in the same order they appear in the form, and parameters
extraction gets the last occurrence of any repeated key in the query
string, that works for ordinary forms.</p>

<p>Unfortunately that workaround does not work when the check box goes within
an array-like parameter, as in</p>

<pre>&lt;%= fields_for &quot;project[invoice_attributes][]&quot;, invoice, :index =&gt; nil do |form| %&gt;
  &lt;%= form.check_box :paid %&gt;
  ...
&lt;% end %&gt;</pre>

<p>because parameter name repetition is precisely what <a
href="../../Rails.html">Rails</a> seeks to distinguish the elements of the
array. For each item with a checked check box you get an extra ghost item
with only that attribute, assigned to “0”.</p>

<p>In that case it is preferable to either use <code>check_box_tag</code> or
to use hashes instead of arrays.</p>

<h4 id="method-i-check_box-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-comment"># Let's say that @post.validated? is 1:</span>
<span class="ruby-identifier">check_box</span>(<span class="ruby-string">&quot;post&quot;</span>, <span class="ruby-string">&quot;validated&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input name=&quot;post[validated]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;</span>
<span class="ruby-comment">#    &lt;input type=&quot;checkbox&quot; id=&quot;post_validated&quot; name=&quot;post[validated]&quot; value=&quot;1&quot; /&gt;</span>

<span class="ruby-comment"># Let's say that @puppy.gooddog is &quot;no&quot;:</span>
<span class="ruby-identifier">check_box</span>(<span class="ruby-string">&quot;puppy&quot;</span>, <span class="ruby-string">&quot;gooddog&quot;</span>, {}, <span class="ruby-string">&quot;yes&quot;</span>, <span class="ruby-string">&quot;no&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input name=&quot;puppy[gooddog]&quot; type=&quot;hidden&quot; value=&quot;no&quot; /&gt;</span>
<span class="ruby-comment">#    &lt;input type=&quot;checkbox&quot; id=&quot;puppy_gooddog&quot; name=&quot;puppy[gooddog]&quot; value=&quot;yes&quot; /&gt;</span>

<span class="ruby-identifier">check_box</span>(<span class="ruby-string">&quot;eula&quot;</span>, <span class="ruby-string">&quot;accepted&quot;</span>, { :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'eula_check'</span> }, <span class="ruby-string">&quot;yes&quot;</span>, <span class="ruby-string">&quot;no&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input name=&quot;eula[accepted]&quot; type=&quot;hidden&quot; value=&quot;no&quot; /&gt;</span>
<span class="ruby-comment">#    &lt;input type=&quot;checkbox&quot; class=&quot;eula_check&quot; id=&quot;eula_accepted&quot; name=&quot;eula[accepted]&quot; value=&quot;yes&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="check_box-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 842</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">check_box</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">checked_value</span> = <span class="ruby-string">&quot;1&quot;</span>, <span class="ruby-identifier">unchecked_value</span> = <span class="ruby-string">&quot;0&quot;</span>)
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_check_box_tag</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">checked_value</span>, <span class="ruby-identifier">unchecked_value</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- check_box-source -->
          
        </div>

        

        
      </div><!-- check_box-method -->

    
      <div id="method-i-convert_to_model" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">convert_to_model</span><span
            class="method-args">(object)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Converts the given object to an <a
href="../../ActiveModel.html">ActiveModel</a> compliant one.</p>
          

          
          <div class="method-source-code" id="convert_to_model-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 109</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">convert_to_model</span>(<span class="ruby-identifier">object</span>)
  <span class="ruby-identifier">object</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_model</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">to_model</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">object</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- convert_to_model-source -->
          
        </div>

        

        
      </div><!-- convert_to_model-method -->

    
      <div id="method-i-email_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">email_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a <a href="FormHelper.html#method-i-text_field">#text_field</a> of
type “email”.</p>

<pre class="ruby"><span class="ruby-identifier">email_field</span>(<span class="ruby-string">&quot;user&quot;</span>, <span class="ruby-string">&quot;address&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input id=&quot;user_address&quot; size=&quot;30&quot; name=&quot;user[address]&quot; type=&quot;email&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="email_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 931</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">email_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;email&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- email_field-source -->
          
        </div>

        

        
      </div><!-- email_field-method -->

    
      <div id="method-i-fields_for" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">fields_for</span><span
            class="method-args">(record_name, record_object = nil, options = {}, &block)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Creates a scope around a specific model object like <a
href="FormHelper.html#method-i-form_for">#form_for</a>, but doesn’t create
the form tags themselves. This makes <a
href="FormHelper.html#method-i-fields_for">#fields_for</a> suitable for
specifying additional model objects in the same form.</p>

<h3 id="method-i-fields_for-label-Generic+Examples">Generic Examples</h3>

<pre>&lt;%= form_for @person do |person_form| %&gt;
  First name: &lt;%= person_form.text_field :first_name %&gt;
  Last name : &lt;%= person_form.text_field :last_name %&gt;

  &lt;%= fields_for @person.permission do |permission_fields| %&gt;
    Admin?  : &lt;%= permission_fields.check_box :admin %&gt;
  &lt;% end %&gt;

  &lt;%= f.submit %&gt;
&lt;% end %&gt;</pre>

<p>…or if you have an object that needs to be represented as a different
parameter, like a Client that acts as a Person:</p>

<pre>&lt;%= fields_for :person, @client do |permission_fields| %&gt;
  Admin?: &lt;%= permission_fields.check_box :admin %&gt;
&lt;% end %&gt;</pre>

<p>…or if you don’t have an object, just a name of the parameter:</p>

<pre>&lt;%= fields_for :person do |permission_fields| %&gt;
  Admin?: &lt;%= permission_fields.check_box :admin %&gt;
&lt;% end %&gt;</pre>

<p>Note: This also works for the methods in FormOptionHelper and <a
href="DateHelper.html">DateHelper</a> that are designed to work with an
object as base, like FormOptionHelper#collection_select and <a
href="DateHelper.html#method-i-datetime_select">ActionView::Helpers::DateHelper#datetime_select</a>.</p>

<h3 id="method-i-fields_for-label-Nested+Attributes+Examples">Nested Attributes Examples</h3>

<p>When the object belonging to the current scope has a nested attribute
writer for a certain attribute, <a
href="FormHelper.html#method-i-fields_for">#fields_for</a> will yield a new
scope for that attribute. This allows you to create forms that set or
change the attributes of a parent object and its associations in one go.</p>

<p>Nested attribute writers are normal setter methods named after an
association. The most common way of defining these writers is either with
<code>accepts_nested_attributes_for</code> in a model definition or by
defining a method with the proper name. For example: the attribute writer
for the association <code>:address</code> is called
<code>address_attributes=</code>.</p>

<p>Whether a one-to-one or one-to-many style form builder will be yielded
depends on whether the normal reader method returns a <em>single</em>
object or an <em>array</em> of objects.</p>

<h4 id="method-i-fields_for-label-One-to-one">One-to-one</h4>

<p>Consider a Person class which returns a <em>single</em> Address from the
<code>address</code> reader method and responds to the
<code>address_attributes=</code> writer method:</p>

<pre class="ruby"><span class="ruby-keyword">class</span> <span class="ruby-constant">Person</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">address</span>
    <span class="ruby-ivar">@address</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">def</span> <span class="ruby-identifier">address_attributes=</span>(<span class="ruby-identifier">attributes</span>)
    <span class="ruby-comment"># Process the attributes hash</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>
</pre>

<p>This model can now be used with a nested <a
href="FormHelper.html#method-i-fields_for">#fields_for</a>, like so:</p>

<pre>&lt;%= form_for @person do |person_form| %&gt;
  ...
  &lt;%= person_form.fields_for :address do |address_fields| %&gt;
    Street  : &lt;%= address_fields.text_field :street %&gt;
    Zip code: &lt;%= address_fields.text_field :zip_code %&gt;
  &lt;% end %&gt;
  ...
&lt;% end %&gt;</pre>

<p>When address is already an association on a Person you can use
<code>accepts_nested_attributes_for</code> to define the writer method for
you:</p>

<pre class="ruby"><span class="ruby-keyword">class</span> <span class="ruby-constant">Person</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
  <span class="ruby-identifier">has_one</span> :<span class="ruby-identifier">address</span>
  <span class="ruby-identifier">accepts_nested_attributes_for</span> :<span class="ruby-identifier">address</span>
<span class="ruby-keyword">end</span>
</pre>

<p>If you want to destroy the associated model through the form, you have to
enable it first using the <code>:allow_destroy</code> option for
<code>accepts_nested_attributes_for</code>:</p>

<pre class="ruby"><span class="ruby-keyword">class</span> <span class="ruby-constant">Person</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
  <span class="ruby-identifier">has_one</span> :<span class="ruby-identifier">address</span>
  <span class="ruby-identifier">accepts_nested_attributes_for</span> :<span class="ruby-identifier">address</span>, :<span class="ruby-identifier">allow_destroy</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span>
</pre>

<p>Now, when you use a form element with the <code>_destroy</code> parameter,
with a value that evaluates to <code>true</code>, you will destroy the
associated model (eg. 1, ‘1’, true, or ‘true’):</p>

<pre>&lt;%= form_for @person do |person_form| %&gt;
  ...
  &lt;%= person_form.fields_for :address do |address_fields| %&gt;
    ...
    Delete: &lt;%= address_fields.check_box :_destroy %&gt;
  &lt;% end %&gt;
  ...
&lt;% end %&gt;</pre>

<h4 id="method-i-fields_for-label-One-to-many">One-to-many</h4>

<p>Consider a Person class which returns an <em>array</em> of Project
instances from the <code>projects</code> reader method and responds to the
<code>projects_attributes=</code> writer method:</p>

<pre class="ruby"><span class="ruby-keyword">class</span> <span class="ruby-constant">Person</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">projects</span>
    [<span class="ruby-ivar">@project1</span>, <span class="ruby-ivar">@project2</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">def</span> <span class="ruby-identifier">projects_attributes=</span>(<span class="ruby-identifier">attributes</span>)
    <span class="ruby-comment"># Process the attributes hash</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>
</pre>

<p>Note that the <code>projects_attributes=</code> writer method is in fact
required for <a href="FormHelper.html#method-i-fields_for">#fields_for</a>
to correctly identify <code>:projects</code> as a collection, and the
correct indices to be set in the form markup.</p>

<p>When projects is already an association on Person you can use
<code>accepts_nested_attributes_for</code> to define the writer method for
you:</p>

<pre class="ruby"><span class="ruby-keyword">class</span> <span class="ruby-constant">Person</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
  <span class="ruby-identifier">has_many</span> :<span class="ruby-identifier">projects</span>
  <span class="ruby-identifier">accepts_nested_attributes_for</span> :<span class="ruby-identifier">projects</span>
<span class="ruby-keyword">end</span>
</pre>

<p>This model can now be used with a nested fields_for. The block given to the
nested <a href="FormHelper.html#method-i-fields_for">#fields_for</a> call
will be repeated for each instance in the collection:</p>

<pre>&lt;%= form_for @person do |person_form| %&gt;
  ...
  &lt;%= person_form.fields_for :projects do |project_fields| %&gt;
    &lt;% if project_fields.object.active? %&gt;
      Name: &lt;%= project_fields.text_field :name %&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  ...
&lt;% end %&gt;</pre>

<p>It’s also possible to specify the instance to be used:</p>

<pre>&lt;%= form_for @person do |person_form| %&gt;
  ...
  &lt;% @person.projects.each do |project| %&gt;
    &lt;% if project.active? %&gt;
      &lt;%= person_form.fields_for :projects, project do |project_fields| %&gt;
        Name: &lt;%= project_fields.text_field :name %&gt;
      &lt;% end %&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  ...
&lt;% end %&gt;</pre>

<p>Or a collection to be used:</p>

<pre>&lt;%= form_for @person do |person_form| %&gt;
  ...
  &lt;%= person_form.fields_for :projects, @active_projects do |project_fields| %&gt;
    Name: &lt;%= project_fields.text_field :name %&gt;
  &lt;% end %&gt;
  ...
&lt;% end %&gt;</pre>

<p>When projects is already an association on Person you can use
<code>accepts_nested_attributes_for</code> to define the writer method for
you:</p>

<pre class="ruby"><span class="ruby-keyword">class</span> <span class="ruby-constant">Person</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
  <span class="ruby-identifier">has_many</span> :<span class="ruby-identifier">projects</span>
  <span class="ruby-identifier">accepts_nested_attributes_for</span> :<span class="ruby-identifier">projects</span>
<span class="ruby-keyword">end</span>
</pre>

<p>If you want to destroy any of the associated models through the form, you
have to enable it first using the <code>:allow_destroy</code> option for
<code>accepts_nested_attributes_for</code>:</p>

<pre class="ruby"><span class="ruby-keyword">class</span> <span class="ruby-constant">Person</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
  <span class="ruby-identifier">has_many</span> :<span class="ruby-identifier">projects</span>
  <span class="ruby-identifier">accepts_nested_attributes_for</span> :<span class="ruby-identifier">projects</span>, :<span class="ruby-identifier">allow_destroy</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span>
</pre>

<p>This will allow you to specify which models to destroy in the attributes
hash by adding a form element for the <code>_destroy</code> parameter with
a value that evaluates to <code>true</code> (eg. 1, ‘1’, true, or ‘true’):</p>

<pre>&lt;%= form_for @person do |person_form| %&gt;
  ...
  &lt;%= person_form.fields_for :projects do |project_fields| %&gt;
    Delete: &lt;%= project_fields.check_box :_destroy %&gt;
  &lt;% end %&gt;
  ...
&lt;% end %&gt;</pre>
          

          
          <div class="method-source-code" id="fields_for-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 605</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">fields_for</span>(<span class="ruby-identifier">record_name</span>, <span class="ruby-identifier">record_object</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">options</span> = {}, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">builder</span> = <span class="ruby-identifier">instantiate_builder</span>(<span class="ruby-identifier">record_name</span>, <span class="ruby-identifier">record_object</span>, <span class="ruby-identifier">options</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">output</span> = <span class="ruby-identifier">capture</span>(<span class="ruby-identifier">builder</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">output</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">hidden_field</span>(<span class="ruby-value">:id</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">output</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:hidden_field_id</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">builder</span>.<span class="ruby-identifier">emitted_hidden_id?</span>
  <span class="ruby-identifier">output</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- fields_for-source -->
          
        </div>

        

        
      </div><!-- fields_for-method -->

    
      <div id="method-i-file_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">file_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a file upload input tag tailored for accessing a specified
attribute (identified by <code>method</code>) on an object assigned to the
template (identified by <code>object</code>). Additional options on the
input tag can be passed as a hash with <code>options</code>. These options
will be tagged onto the <a href="../../HTML.html">HTML</a> as an <a
href="../../HTML.html">HTML</a> element attribute as in the example shown.</p>

<p>Using this method inside a <code>form_for</code> block will set the
enclosing form’s encoding to <code>multipart/form-data</code>.</p>

<h4 id="method-i-file_field-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-identifier">file_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">avatar</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;file&quot; id=&quot;user_avatar&quot; name=&quot;user[avatar]&quot; /&gt;</span>

<span class="ruby-identifier">file_field</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">attached</span>, :<span class="ruby-identifier">accept</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'text/html'</span>)
<span class="ruby-comment"># =&gt; &lt;input accept=&quot;text/html&quot; type=&quot;file&quot; id=&quot;post_attached&quot; name=&quot;post[attached]&quot; /&gt;</span>

<span class="ruby-identifier">file_field</span>(:<span class="ruby-identifier">attachment</span>, :<span class="ruby-identifier">file</span>, :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'file_input'</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;file&quot; id=&quot;attachment_file&quot; name=&quot;attachment[file]&quot; class=&quot;file_input&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="file_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 752</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">file_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;file&quot;</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">update</span>({<span class="ruby-value">:size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">nil</span>}))
<span class="ruby-keyword">end</span></pre>
          </div><!-- file_field-source -->
          
        </div>

        

        
      </div><!-- file_field-method -->

    
      <div id="method-i-form_for" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">form_for</span><span
            class="method-args">(record, options = {}, &proc)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Creates a form and a scope around a specific model object that is used as a
base for questioning about values for the fields.</p>

<p><a href="../../Rails.html">Rails</a> provides succinct resource-oriented
form generation with <code>form_for</code> like this:</p>

<pre>&lt;%= form_for @offer do |f| %&gt;
  &lt;%= f.label :version, 'Version' %&gt;:
  &lt;%= f.text_field :version %&gt;&lt;br /&gt;
  &lt;%= f.label :author, 'Author' %&gt;:
  &lt;%= f.text_field :author %&gt;&lt;br /&gt;
  &lt;%= f.submit %&gt;
&lt;% end %&gt;</pre>

<p>There, <code>form_for</code> is able to generate the rest of RESTful form
parameters based on introspection on the record, but to understand what it
does we need to dig first into the alternative generic usage it is based
upon.</p>

<h3 id="method-i-form_for-label-Generic+form_for">Generic <a href="FormHelper.html#method-i-form_for">#form_for</a></h3>

<p>The generic way to call <code>form_for</code> yields a form builder around
a model:</p>

<pre>&lt;%= form_for :person do |f| %&gt;
  First name: &lt;%= f.text_field :first_name %&gt;&lt;br /&gt;
  Last name : &lt;%= f.text_field :last_name %&gt;&lt;br /&gt;
  Biography : &lt;%= f.text_area :biography %&gt;&lt;br /&gt;
  Admin?    : &lt;%= f.check_box :admin %&gt;&lt;br /&gt;
  &lt;%= f.submit %&gt;
&lt;% end %&gt;</pre>

<p>There, the argument is a symbol or string with the name of the object the
form is about.</p>

<p>The form builder acts as a regular form helper that somehow carries the
model. Thus, the idea is that</p>

<pre>&lt;%= f.text_field :first_name %&gt;</pre>

<p>gets expanded to</p>

<pre>&lt;%= text_field :person, :first_name %&gt;</pre>

<p>The rightmost argument to <code>form_for</code> is an optional hash of
options:</p>
<ul><li>
<p><code>:url</code> - The URL the form is submitted to. It takes the same
fields you pass to <code>url_for</code> or <code>link_to</code>. In
particular you may pass here a named route directly as well. Defaults to
the current action.</p>
</li><li>
<p><code>:namespace</code> - A namespace for your form to ensure uniqueness of
id attributes on form elements. The namespace attribute will be prefixed
with underscore on the generated <a href="../../HTML.html">HTML</a> id.</p>
</li><li>
<p><code>:html</code> - Optional <a href="../../HTML.html">HTML</a> attributes
for the form tag.</p>
</li></ul>

<p>Also note that <code>form_for</code> doesn’t create an exclusive scope.
It’s still possible to use both the stand-alone <a
href="FormHelper.html">FormHelper</a> methods and methods from <a
href="FormTagHelper.html">FormTagHelper</a>. For example:</p>

<pre>&lt;%= form_for @person do |f| %&gt;
  First name: &lt;%= f.text_field :first_name %&gt;
  Last name : &lt;%= f.text_field :last_name %&gt;
  Biography : &lt;%= text_area :person, :biography %&gt;
  Admin?    : &lt;%= check_box_tag &quot;person[admin]&quot;, @person.company.admin? %&gt;
  &lt;%= f.submit %&gt;
&lt;% end %&gt;</pre>

<p>This also works for the methods in FormOptionHelper and <a
href="DateHelper.html">DateHelper</a> that are designed to work with an
object as base, like FormOptionHelper#collection_select and <a
href="DateHelper.html#method-i-datetime_select">ActionView::Helpers::DateHelper#datetime_select</a>.</p>

<h3 id="method-i-form_for-label-Resource-oriented+style">Resource-oriented style</h3>

<p>As we said above, in addition to manually configuring the
<code>form_for</code> call, you can rely on automated resource
identification, which will use the conventions and named routes of that
approach. This is the preferred way to use <code>form_for</code> nowadays.</p>

<p>For example, if <code>@post</code> is an existing record you want to edit</p>

<pre>&lt;%= form_for @post do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>is equivalent to something like:</p>

<pre>&lt;%= form_for @post, :as =&gt; :post, :url =&gt; post_path(@post), :method =&gt; :put, :html =&gt; { :class =&gt; &quot;edit_post&quot;, :id =&gt; &quot;edit_post_45&quot; } do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>And for new records</p>

<pre>&lt;%= form_for(Post.new) do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>is equivalent to something like:</p>

<pre>&lt;%= form_for @post, :as =&gt; :post, :url =&gt; posts_path, :html =&gt; { :class =&gt; &quot;new_post&quot;, :id =&gt; &quot;new_post&quot; } do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>You can also overwrite the individual conventions, like this:</p>

<pre>&lt;%= form_for(@post, :url =&gt; super_posts_path) do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>You can also set the answer format, like this:</p>

<pre>&lt;%= form_for(@post, :format =&gt; :json) do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>If you have an object that needs to be represented as a different
parameter, like a Person that acts as a Client:</p>

<pre>&lt;%= form_for(@person, :as =&gt; :client) do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>For namespaced routes, like <code>admin_post_url</code>:</p>

<pre>&lt;%= form_for([:admin, @post]) do |f| %&gt;
 ...
&lt;% end %&gt;</pre>

<p>If your resource has associations defined, for example, you want to add
comments to the document given that the routes are set correctly:</p>

<pre>&lt;%= form_for([@document, @comment]) do |f| %&gt;
 ...
&lt;% end %&gt;</pre>

<p>Where <code>@document = Document.find(params[:id])</code> and
<code>@comment = Comment.new</code>.</p>

<h3 id="method-i-form_for-label-Setting+the+method">Setting the method</h3>

<p>You can force the form to use the full array of HTTP verbs by setting</p>

<pre class="ruby">:<span class="ruby-identifier">method</span> =<span class="ruby-operator">&gt;</span> (:<span class="ruby-identifier">get</span><span class="ruby-operator">|</span>:<span class="ruby-identifier">post</span><span class="ruby-operator">|</span>:<span class="ruby-identifier">put</span><span class="ruby-operator">|</span>:<span class="ruby-identifier">delete</span>)
</pre>

<p>in the options hash. If the verb is not GET or POST, which are natively
supported by <a href="../../HTML.html">HTML</a> forms, the form will be set
to POST and a hidden input called _method will carry the intended verb for
the server to interpret.</p>

<h3 id="method-i-form_for-label-Unobtrusive+JavaScript">Unobtrusive JavaScript</h3>

<p>Specifying:</p>

<pre class="ruby">:<span class="ruby-identifier">remote</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>
</pre>

<p>in the options hash creates a form that will allow the unobtrusive
JavaScript drivers to modify its behavior. The expected default behavior is
an XMLHttpRequest in the background instead of the regular POST
arrangement, but ultimately the behavior is the choice of the JavaScript
driver implementor. Even though it’s using JavaScript to serialize the form
elements, the form submission will work just like a regular submission as
viewed by the receiving side (all elements available in
<code>params</code>).</p>

<p>Example:</p>

<pre>&lt;%= form_for(@post, :remote =&gt; true) do |f| %&gt;
  ...
&lt;% end %&gt;</pre>

<p>The <a href="../../HTML.html">HTML</a> generated for this would be:</p>

<pre>&lt;form action='http://www.example.com' method='post' data-remote='true'&gt;
  &lt;div style='margin:0;padding:0;display:inline'&gt;
    &lt;input name='_method' type='hidden' value='put' /&gt;
  &lt;/div&gt;
  ...
&lt;/form&gt;</pre>

<h3 id="method-i-form_for-label-Removing+hidden+model+id%27s">Removing hidden model id’s</h3>

<p>The <a href="FormHelper.html#method-i-form_for">#form_for</a> method
automatically includes the model id as a hidden field in the form. This is
used to maintain the correlation between the form data and its associated
model. Some ORM systems do not use IDs on nested models so in this case you
want to be able to disable the hidden id.</p>

<p>In the following example the Post model has many Comments stored within it
in a NoSQL database, thus there is no primary key for comments.</p>

<p>Example:</p>

<pre>&lt;%= form_for(@post) do |f| %&gt;
  &lt;% f.fields_for(:comments, :include_id =&gt; false) do |cf| %&gt;
    ...
  &lt;% end %&gt;
&lt;% end %&gt;</pre>

<h3 id="method-i-form_for-label-Customized+form+builders">Customized form builders</h3>

<p>You can also build forms using a customized <a
href="FormBuilder.html">FormBuilder</a> class. Subclass <a
href="FormBuilder.html">FormBuilder</a> and override or define some more
helpers, then use your custom builder. For example, let’s say you made a
helper to automatically add labels to form inputs.</p>

<pre>&lt;%= form_for @person, :url =&gt; { :action =&gt; &quot;create&quot; }, :builder =&gt; LabellingFormBuilder do |f| %&gt;
  &lt;%= f.text_field :first_name %&gt;
  &lt;%= f.text_field :last_name %&gt;
  &lt;%= f.text_area :biography %&gt;
  &lt;%= f.check_box :admin %&gt;
  &lt;%= f.submit %&gt;
&lt;% end %&gt;</pre>

<p>In this case, if you use this:</p>

<pre>&lt;%= render f %&gt;</pre>

<p>The rendered template is <code>people/_labelling_form</code> and the local
variable referencing the form builder is called
<code>labelling_form</code>.</p>

<p>The custom <a href="FormBuilder.html">FormBuilder</a> class is
automatically merged with the options of a nested <a
href="FormHelper.html#method-i-fields_for">#fields_for</a> call, unless
it’s explicitly set.</p>

<p>In many cases you will want to wrap the above in another helper, so you
could do something like the following:</p>

<pre class="ruby"><span class="ruby-keyword">def</span> <span class="ruby-identifier">labelled_form_for</span>(<span class="ruby-identifier">record_or_name_or_array</span>, *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">proc</span>)
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">extract_options!</span>
  <span class="ruby-identifier">form_for</span>(<span class="ruby-identifier">record_or_name_or_array</span>, *(<span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(:<span class="ruby-identifier">builder</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">LabellingFormBuilder</span>)), &amp;<span class="ruby-identifier">proc</span>)
<span class="ruby-keyword">end</span>
</pre>

<p>If you don’t need to attach a form to a model instance, then check out <a
href="FormTagHelper.html#method-i-form_tag">ActionView::Helpers::FormTagHelper#form_tag</a>.</p>

<h3 id="method-i-form_for-label-Form+to+external+resources">Form to external resources</h3>

<p>When you build forms to external resources sometimes you need to set an
authenticity token or just render a form without it, for example when you
submit data to a payment gateway number and types of fields could be
limited.</p>

<p>To set an authenticity token you need to pass an
<code>:authenticity_token</code> parameter</p>

<pre>&lt;%= form_for @invoice, :url =&gt; external_url, :authenticity_token =&gt; 'external_token' do |f|
  ...
&lt;% end %&gt;</pre>

<p>If you don’t want to an authenticity token field be rendered at all just
pass <code>false</code>:</p>

<pre>&lt;%= form_for @invoice, :url =&gt; external_url, :authenticity_token =&gt; false do |f|
  ...
&lt;% end %&gt;</pre>
          

          
          <div class="method-source-code" id="form_for-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 358</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">form_for</span>(<span class="ruby-identifier">record</span>, <span class="ruby-identifier">options</span> = {}, &amp;<span class="ruby-identifier">proc</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">&quot;Missing block&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">block_given?</span>

  <span class="ruby-identifier">options</span>[<span class="ruby-value">:html</span>] <span class="ruby-operator">||=</span> {}

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">record</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>, <span class="ruby-constant">Symbol</span>
    <span class="ruby-identifier">object_name</span> = <span class="ruby-identifier">record</span>
    <span class="ruby-identifier">object</span>      = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">object</span>      = <span class="ruby-identifier">record</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">record</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">record</span>
    <span class="ruby-identifier">object_name</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:as</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ActiveModel</span><span class="ruby-operator">::</span><span class="ruby-constant">Naming</span>.<span class="ruby-identifier">param_key</span>(<span class="ruby-identifier">object</span>)
    <span class="ruby-identifier">apply_form_for_options!</span>(<span class="ruby-identifier">record</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">options</span>[<span class="ruby-value">:html</span>][<span class="ruby-value">:remote</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:remote</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:remote</span>)
  <span class="ruby-identifier">options</span>[<span class="ruby-value">:html</span>][<span class="ruby-value">:method</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:method</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-value">:method</span>)
  <span class="ruby-identifier">options</span>[<span class="ruby-value">:html</span>][<span class="ruby-value">:authenticity_token</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:authenticity_token</span>)

  <span class="ruby-identifier">builder</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:parent_builder</span>] = <span class="ruby-identifier">instantiate_builder</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">object</span>, <span class="ruby-identifier">options</span>, &amp;<span class="ruby-identifier">proc</span>)
  <span class="ruby-identifier">fields_for</span> = <span class="ruby-identifier">fields_for</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">object</span>, <span class="ruby-identifier">options</span>, &amp;<span class="ruby-identifier">proc</span>)
  <span class="ruby-identifier">default_options</span> = <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">multipart?</span> <span class="ruby-operator">?</span> { <span class="ruby-value">:multipart</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span> } <span class="ruby-operator">:</span> {}
  <span class="ruby-identifier">output</span> = <span class="ruby-identifier">form_tag</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:url</span>) <span class="ruby-operator">||</span> {}, <span class="ruby-identifier">default_options</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:html</span>)))
  <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fields_for</span>
  <span class="ruby-identifier">output</span>.<span class="ruby-identifier">safe_concat</span>(<span class="ruby-string">'&lt;/form&gt;'</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- form_for-source -->
          
        </div>

        

        
      </div><!-- form_for-method -->

    
      <div id="method-i-hidden_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">hidden_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a hidden input tag tailored for accessing a specified attribute
(identified by <code>method</code>) on an object assigned to the template
(identified by <code>object</code>). Additional options on the input tag
can be passed as a hash with <code>options</code>. These options will be
tagged onto the <a href="../../HTML.html">HTML</a> as an <a
href="../../HTML.html">HTML</a> element attribute as in the example shown.</p>

<h4 id="method-i-hidden_field-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-identifier">hidden_field</span>(:<span class="ruby-identifier">signup</span>, :<span class="ruby-identifier">pass_confirm</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;hidden&quot; id=&quot;signup_pass_confirm&quot; name=&quot;signup[pass_confirm]&quot; value=&quot;#{@signup.pass_confirm}&quot; /&gt;</span>

<span class="ruby-identifier">hidden_field</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">tag_list</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;hidden&quot; id=&quot;post_tag_list&quot; name=&quot;post[tag_list]&quot; value=&quot;#{@post.tag_list}&quot; /&gt;</span>

<span class="ruby-identifier">hidden_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">token</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;hidden&quot; id=&quot;user_token&quot; name=&quot;user[token]&quot; value=&quot;#{@user.token}&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="hidden_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 731</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">hidden_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;hidden&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- hidden_field-source -->
          
        </div>

        

        
      </div><!-- hidden_field-method -->

    
      <div id="method-i-label" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">label</span><span
            class="method-args">(object_name, method, content_or_options = nil, options = nil, &block)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a label tag tailored for labelling an input field for a specified
attribute (identified by <code>method</code>) on an object assigned to the
template (identified by <code>object</code>). The text of label will
default to the attribute name unless a translation is found in the current
<a href="../../I18n.html">I18n</a> locale (through
helpers.label.&lt;modelname&gt;.&lt;attribute&gt;) or you specify it
explicitly. Additional options on the label tag can be passed as a hash
with <code>options</code>. These options will be tagged onto the <a
href="../../HTML.html">HTML</a> as an <a href="../../HTML.html">HTML</a>
element attribute as in the example shown, except for the
<code>:value</code> option, which is designed to target labels for <a
href="FormHelper.html#method-i-radio_button">#radio_button</a> tags (where
the value is used in the ID of the input tag).</p>

<h4 id="method-i-label-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-identifier">label</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">title</span>)
<span class="ruby-comment"># =&gt; &lt;label for=&quot;post_title&quot;&gt;Title&lt;/label&gt;</span>

<span class="ruby-constant">You</span> <span class="ruby-identifier">can</span> <span class="ruby-identifier">localize</span> <span class="ruby-identifier">your</span> <span class="ruby-identifier">labels</span> <span class="ruby-identifier">based</span> <span class="ruby-identifier">on</span> <span class="ruby-identifier">model</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">attribute</span> <span class="ruby-identifier">names</span>.
<span class="ruby-constant">For</span> <span class="ruby-identifier">example</span> <span class="ruby-identifier">you</span> <span class="ruby-identifier">can</span> <span class="ruby-identifier">define</span> <span class="ruby-identifier">the</span> <span class="ruby-identifier">following</span> <span class="ruby-keyword">in</span> <span class="ruby-identifier">your</span> <span class="ruby-identifier">locale</span> (<span class="ruby-identifier">e</span>.<span class="ruby-identifier">g</span>. <span class="ruby-identifier">en</span>.<span class="ruby-identifier">yml</span>)

<span class="ruby-identifier">helpers</span><span class="ruby-operator">:</span>
  <span class="ruby-identifier">label</span><span class="ruby-operator">:</span>
    <span class="ruby-identifier">post</span><span class="ruby-operator">:</span>
      <span class="ruby-identifier">body</span><span class="ruby-operator">:</span> <span class="ruby-string">&quot;Write your entire text here&quot;</span>

<span class="ruby-constant">Which</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">will</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword">in</span>

<span class="ruby-identifier">label</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">body</span>)
<span class="ruby-comment"># =&gt; &lt;label for=&quot;post_body&quot;&gt;Write your entire text here&lt;/label&gt;</span>
</pre>

<p>Localization can also be based purely on the translation of the
attribute-name (if you are using <a
href="../../ActiveRecord.html">ActiveRecord</a>):</p>

<pre class="ruby"><span class="ruby-identifier">activerecord</span><span class="ruby-operator">:</span>
  <span class="ruby-identifier">attributes</span><span class="ruby-operator">:</span>
    <span class="ruby-identifier">post</span><span class="ruby-operator">:</span>
      <span class="ruby-identifier">cost</span><span class="ruby-operator">:</span> <span class="ruby-string">&quot;Total cost&quot;</span>

<span class="ruby-identifier">label</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">cost</span>)
<span class="ruby-comment"># =&gt; &lt;label for=&quot;post_cost&quot;&gt;Total cost&lt;/label&gt;</span>

<span class="ruby-identifier">label</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">title</span>, <span class="ruby-string">&quot;A short title&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;label for=&quot;post_title&quot;&gt;A short title&lt;/label&gt;</span>

<span class="ruby-identifier">label</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">title</span>, <span class="ruby-string">&quot;A short title&quot;</span>, :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;title_label&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;label for=&quot;post_title&quot; class=&quot;title_label&quot;&gt;A short title&lt;/label&gt;</span>

<span class="ruby-identifier">label</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">privacy</span>, <span class="ruby-string">&quot;Public Post&quot;</span>, :<span class="ruby-identifier">value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;public&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;label for=&quot;post_privacy_public&quot;&gt;Public Post&lt;/label&gt;</span>

<span class="ruby-identifier">label</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">terms</span>) <span class="ruby-keyword">do</span>
  <span class="ruby-string">'Accept &lt;a href=&quot;/terms&quot;&gt;Terms&lt;/a&gt;.'</span>.<span class="ruby-identifier">html_safe</span>
<span class="ruby-keyword">end</span>
</pre>
          

          
          <div class="method-source-code" id="label-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 659</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">label</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">content_or_options</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">options</span> <span class="ruby-operator">||=</span> {}

  <span class="ruby-identifier">content_is_options</span> = <span class="ruby-identifier">content_or_options</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">content_is_options</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">block_given?</span>
    <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">content_or_options</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">content_is_options</span>
    <span class="ruby-identifier">text</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">text</span> = <span class="ruby-identifier">content_or_options</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_label_tag</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span>, &amp;<span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- label-source -->
          
        </div>

        

        
      </div><!-- label-method -->

    
      <div id="method-i-number_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">number_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns an input tag of type “number”.</p>

<h4 id="method-i-number_field-label-Options">Options</h4>
<ul><li>
<p>Accepts same options as number_field_tag</p>
</li></ul>
          

          
          <div class="method-source-code" id="number_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 939</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">number_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_number_field_tag</span>(<span class="ruby-string">&quot;number&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- number_field-source -->
          
        </div>

        

        
      </div><!-- number_field-method -->

    
      <div id="method-i-password_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">password_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns an input tag of the “password” type tailored for accessing a
specified attribute (identified by <code>method</code>) on an object
assigned to the template (identified by <code>object</code>). Additional
options on the input tag can be passed as a hash with <code>options</code>.
These options will be tagged onto the <a href="../../HTML.html">HTML</a> as
an <a href="../../HTML.html">HTML</a> element attribute as in the example
shown.</p>

<h4 id="method-i-password_field-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-identifier">password_field</span>(:<span class="ruby-identifier">login</span>, :<span class="ruby-identifier">pass</span>, :<span class="ruby-identifier">size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;password&quot; id=&quot;login_pass&quot; name=&quot;login[pass]&quot; size=&quot;20&quot; /&gt;</span>

<span class="ruby-identifier">password_field</span>(:<span class="ruby-identifier">account</span>, :<span class="ruby-identifier">secret</span>, :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;form_input&quot;</span>, :<span class="ruby-identifier">value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@account</span>.<span class="ruby-identifier">secret</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;password&quot; id=&quot;account_secret&quot; name=&quot;account[secret]&quot; value=&quot;#{@account.secret}&quot; class=&quot;form_input&quot; /&gt;</span>

<span class="ruby-identifier">password_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">password</span>, :<span class="ruby-identifier">onchange</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;if $('user[password]').length &gt; 30 { alert('Your password needs to be shorter!'); }&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;password&quot; id=&quot;user_password&quot; name=&quot;user[password]&quot; onchange = &quot;if $('user[password]').length &gt; 30 { alert('Your password needs to be shorter!'); }&quot;/&gt;</span>

<span class="ruby-identifier">password_field</span>(:<span class="ruby-identifier">account</span>, :<span class="ruby-identifier">pin</span>, :<span class="ruby-identifier">size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>, :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'form_input'</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;password&quot; id=&quot;account_pin&quot; name=&quot;account[pin]&quot; size=&quot;20&quot; class=&quot;form_input&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="password_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 713</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">password_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;password&quot;</span>, { <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">nil</span> }.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">options</span>))
<span class="ruby-keyword">end</span></pre>
          </div><!-- password_field-source -->
          
        </div>

        

        
      </div><!-- password_field-method -->

    
      <div id="method-i-phone_field" class="method-detail method-alias">
        
        <div class="method-heading">
          <span class="method-name">phone_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
        </div>

        

        
        <div class="aliases">
          Alias for: <a href="FormHelper.html#method-i-telephone_field">telephone_field</a>
        </div>
        
      </div><!-- phone_field-method -->

    
      <div id="method-i-radio_button" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">radio_button</span><span
            class="method-args">(object_name, method, tag_value, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a radio button tag for accessing a specified attribute (identified
by <code>method</code>) on an object assigned to the template (identified
by <code>object</code>). If the current value of <code>method</code> is
<code>tag_value</code> the radio button will be checked.</p>

<p>To force the radio button to be checked pass <code>:checked =&gt;
true</code> in the <code>options</code> hash. You may pass <a
href="../../HTML.html">HTML</a> options there as well.</p>

<h4 id="method-i-radio_button-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-comment"># Let's say that @post.category returns &quot;rails&quot;:</span>
<span class="ruby-identifier">radio_button</span>(<span class="ruby-string">&quot;post&quot;</span>, <span class="ruby-string">&quot;category&quot;</span>, <span class="ruby-string">&quot;rails&quot;</span>)
<span class="ruby-identifier">radio_button</span>(<span class="ruby-string">&quot;post&quot;</span>, <span class="ruby-string">&quot;category&quot;</span>, <span class="ruby-string">&quot;java&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;radio&quot; id=&quot;post_category_rails&quot; name=&quot;post[category]&quot; value=&quot;rails&quot; checked=&quot;checked&quot; /&gt;</span>
<span class="ruby-comment">#    &lt;input type=&quot;radio&quot; id=&quot;post_category_java&quot; name=&quot;post[category]&quot; value=&quot;java&quot; /&gt;</span>

<span class="ruby-identifier">radio_button</span>(<span class="ruby-string">&quot;user&quot;</span>, <span class="ruby-string">&quot;receive_newsletter&quot;</span>, <span class="ruby-string">&quot;yes&quot;</span>)
<span class="ruby-identifier">radio_button</span>(<span class="ruby-string">&quot;user&quot;</span>, <span class="ruby-string">&quot;receive_newsletter&quot;</span>, <span class="ruby-string">&quot;no&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;radio&quot; id=&quot;user_receive_newsletter_yes&quot; name=&quot;user[receive_newsletter]&quot; value=&quot;yes&quot; /&gt;</span>
<span class="ruby-comment">#    &lt;input type=&quot;radio&quot; id=&quot;user_receive_newsletter_no&quot; name=&quot;user[receive_newsletter]&quot; value=&quot;no&quot; checked=&quot;checked&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="radio_button-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 864</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">radio_button</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">tag_value</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_radio_button_tag</span>(<span class="ruby-identifier">tag_value</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- radio_button-source -->
          
        </div>

        

        
      </div><!-- radio_button-method -->

    
      <div id="method-i-range_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">range_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns an input tag of type “range”.</p>

<h4 id="method-i-range_field-label-Options">Options</h4>
<ul><li>
<p>Accepts same options as range_field_tag</p>
</li></ul>
          

          
          <div class="method-source-code" id="range_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 947</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">range_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_number_field_tag</span>(<span class="ruby-string">&quot;range&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- range_field-source -->
          
        </div>

        

        
      </div><!-- range_field-method -->

    
      <div id="method-i-search_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">search_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns an input of type “search” for accessing a specified attribute
(identified by <code>method</code>) on an object assigned to the template
(identified by <code>object_name</code>). Inputs of type “search” may be
styled differently by some browsers.</p>

<h4 id="method-i-search_field-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-identifier">search_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">name</span>)
<span class="ruby-comment"># =&gt; &lt;input id=&quot;user_name&quot; name=&quot;user[name]&quot; size=&quot;30&quot; type=&quot;search&quot; /&gt;</span>
<span class="ruby-identifier">search_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">name</span>, :<span class="ruby-identifier">autosave</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span>)
<span class="ruby-comment"># =&gt; &lt;input autosave=&quot;false&quot; id=&quot;user_name&quot; name=&quot;user[name]&quot; size=&quot;30&quot; type=&quot;search&quot; /&gt;</span>
<span class="ruby-identifier">search_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">name</span>, :<span class="ruby-identifier">results</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">3</span>)
<span class="ruby-comment"># =&gt; &lt;input id=&quot;user_name&quot; name=&quot;user[name]&quot; results=&quot;3&quot; size=&quot;30&quot; type=&quot;search&quot; /&gt;</span>
<span class="ruby-comment">#  Assume request.host returns &quot;www.example.com&quot;</span>
<span class="ruby-identifier">search_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">name</span>, :<span class="ruby-identifier">autosave</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>)
<span class="ruby-comment"># =&gt; &lt;input autosave=&quot;com.example.www&quot; id=&quot;user_name&quot; name=&quot;user[name]&quot; results=&quot;10&quot; size=&quot;30&quot; type=&quot;search&quot; /&gt;</span>
<span class="ruby-identifier">search_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">name</span>, :<span class="ruby-identifier">onsearch</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>)
<span class="ruby-comment"># =&gt; &lt;input id=&quot;user_name&quot; incremental=&quot;true&quot; name=&quot;user[name]&quot; onsearch=&quot;true&quot; size=&quot;30&quot; type=&quot;search&quot; /&gt;</span>
<span class="ruby-identifier">search_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">name</span>, :<span class="ruby-identifier">autosave</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span>, :<span class="ruby-identifier">onsearch</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>)
<span class="ruby-comment"># =&gt; &lt;input autosave=&quot;false&quot; id=&quot;user_name&quot; incremental=&quot;true&quot; name=&quot;user[name]&quot; onsearch=&quot;true&quot; size=&quot;30&quot; type=&quot;search&quot; /&gt;</span>
<span class="ruby-identifier">search_field</span>(:<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">name</span>, :<span class="ruby-identifier">autosave</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>, :<span class="ruby-identifier">onsearch</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">true</span>)
<span class="ruby-comment"># =&gt; &lt;input autosave=&quot;com.example.www&quot; id=&quot;user_name&quot; incremental=&quot;true&quot; name=&quot;user[name]&quot; onsearch=&quot;true&quot; results=&quot;10&quot; size=&quot;30&quot; type=&quot;search&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="search_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 890</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">search_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">stringify_keys</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;autosave&quot;</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;autosave&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">true</span>
      <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;autosave&quot;</span>] = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">host</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;.&quot;</span>).<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;.&quot;</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;results&quot;</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">10</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;onsearch&quot;</span>]
    <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;incremental&quot;</span>] = <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-string">&quot;incremental&quot;</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">&quot;object&quot;</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;search&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- search_field-source -->
          
        </div>

        

        
      </div><!-- search_field-method -->

    
      <div id="method-i-telephone_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">telephone_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a <a href="FormHelper.html#method-i-text_field">#text_field</a> of
type “tel”.</p>

<pre class="ruby"><span class="ruby-identifier">telephone_field</span>(<span class="ruby-string">&quot;user&quot;</span>, <span class="ruby-string">&quot;phone&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input id=&quot;user_phone&quot; name=&quot;user[phone]&quot; size=&quot;30&quot; type=&quot;tel&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="telephone_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 912</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">telephone_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;tel&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- telephone_field-source -->
          
        </div>

        
        <div class="aliases">
          Also aliased as: <a href="FormHelper.html#method-i-phone_field">phone_field</a>
        </div>
        

        
      </div><!-- telephone_field-method -->

    
      <div id="method-i-text_area" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">text_area</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a textarea opening and closing tag set tailored for accessing a
specified attribute (identified by <code>method</code>) on an object
assigned to the template (identified by <code>object</code>). Additional
options on the input tag can be passed as a hash with <code>options</code>.</p>

<h4 id="method-i-text_area-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-identifier">text_area</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">body</span>, :<span class="ruby-identifier">cols</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>, :<span class="ruby-identifier">rows</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">40</span>)
<span class="ruby-comment"># =&gt; &lt;textarea cols=&quot;20&quot; rows=&quot;40&quot; id=&quot;post_body&quot; name=&quot;post[body]&quot;&gt;</span>
<span class="ruby-comment">#      #{@post.body}</span>
<span class="ruby-comment">#    &lt;/textarea&gt;</span>

<span class="ruby-identifier">text_area</span>(:<span class="ruby-identifier">comment</span>, :<span class="ruby-identifier">text</span>, :<span class="ruby-identifier">size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;20x30&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;textarea cols=&quot;20&quot; rows=&quot;30&quot; id=&quot;comment_text&quot; name=&quot;comment[text]&quot;&gt;</span>
<span class="ruby-comment">#      #{@comment.text}</span>
<span class="ruby-comment">#    &lt;/textarea&gt;</span>

<span class="ruby-identifier">text_area</span>(:<span class="ruby-identifier">application</span>, :<span class="ruby-identifier">notes</span>, :<span class="ruby-identifier">cols</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">40</span>, :<span class="ruby-identifier">rows</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">15</span>, :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'app_input'</span>)
<span class="ruby-comment"># =&gt; &lt;textarea cols=&quot;40&quot; rows=&quot;15&quot; id=&quot;application_notes&quot; name=&quot;application[notes]&quot; class=&quot;app_input&quot;&gt;</span>
<span class="ruby-comment">#      #{@application.notes}</span>
<span class="ruby-comment">#    &lt;/textarea&gt;</span>

<span class="ruby-identifier">text_area</span>(:<span class="ruby-identifier">entry</span>, :<span class="ruby-identifier">body</span>, :<span class="ruby-identifier">size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;20x20&quot;</span>, :<span class="ruby-identifier">disabled</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'disabled'</span>)
<span class="ruby-comment"># =&gt; &lt;textarea cols=&quot;20&quot; rows=&quot;20&quot; id=&quot;entry_body&quot; name=&quot;entry[body]&quot; disabled=&quot;disabled&quot;&gt;</span>
<span class="ruby-comment">#      #{@entry.body}</span>
<span class="ruby-comment">#    &lt;/textarea&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="text_area-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 780</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">text_area</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_text_area_tag</span>(<span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- text_area-source -->
          
        </div>

        

        
      </div><!-- text_area-method -->

    
      <div id="method-i-text_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">text_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns an input tag of the “text” type tailored for accessing a specified
attribute (identified by <code>method</code>) on an object assigned to the
template (identified by <code>object</code>). Additional options on the
input tag can be passed as a hash with <code>options</code>. These options
will be tagged onto the <a href="../../HTML.html">HTML</a> as an <a
href="../../HTML.html">HTML</a> element attribute as in the example shown.</p>

<h4 id="method-i-text_field-label-Examples">Examples</h4>

<pre class="ruby"><span class="ruby-identifier">text_field</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">title</span>, :<span class="ruby-identifier">size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;text&quot; id=&quot;post_title&quot; name=&quot;post[title]&quot; size=&quot;20&quot; value=&quot;#{@post.title}&quot; /&gt;</span>

<span class="ruby-identifier">text_field</span>(:<span class="ruby-identifier">post</span>, :<span class="ruby-identifier">title</span>, :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;create_input&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;text&quot; id=&quot;post_title&quot; name=&quot;post[title]&quot; value=&quot;#{@post.title}&quot; class=&quot;create_input&quot; /&gt;</span>

<span class="ruby-identifier">text_field</span>(:<span class="ruby-identifier">session</span>, :<span class="ruby-identifier">user</span>, :<span class="ruby-identifier">onchange</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;if $('session[user]').value == 'admin' { alert('Your login can not be admin!'); }&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;text&quot; id=&quot;session_user&quot; name=&quot;session[user]&quot; value=&quot;#{@session.user}&quot; onchange = &quot;if $('session[user]').value == 'admin' { alert('Your login can not be admin!'); }&quot;/&gt;</span>

<span class="ruby-identifier">text_field</span>(:<span class="ruby-identifier">snippet</span>, :<span class="ruby-identifier">code</span>, :<span class="ruby-identifier">size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>, :<span class="ruby-keyword">class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'code_input'</span>)
<span class="ruby-comment"># =&gt; &lt;input type=&quot;text&quot; id=&quot;snippet_code&quot; name=&quot;snippet[code]&quot; size=&quot;20&quot; value=&quot;#{@snippet.code}&quot; class=&quot;code_input&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="text_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 691</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">text_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;text&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- text_field-source -->
          
        </div>

        

        
      </div><!-- text_field-method -->

    
      <div id="method-i-url_field" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">url_field</span><span
            class="method-args">(object_name, method, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns a <a href="FormHelper.html#method-i-text_field">#text_field</a> of
type “url”.</p>

<pre class="ruby"><span class="ruby-identifier">url_field</span>(<span class="ruby-string">&quot;user&quot;</span>, <span class="ruby-string">&quot;homepage&quot;</span>)
<span class="ruby-comment"># =&gt; &lt;input id=&quot;user_homepage&quot; size=&quot;30&quot; name=&quot;user[homepage]&quot; type=&quot;url&quot; /&gt;</span>
</pre>
          

          
          <div class="method-source-code" id="url_field-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.7/lib/action_view/helpers/form_helper.rb, line 922</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">url_field</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:object</span>)).<span class="ruby-identifier">to_input_field_tag</span>(<span class="ruby-string">&quot;url&quot;</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- url_field-source -->
          
        </div>

        

        
      </div><!-- url_field-method -->

    
    </section><!-- public-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

